Skip to content

Commit c362302

Browse files
committed
test(middleware): use setImmediate for MacOS CI
1 parent 8c2d686 commit c362302

File tree

4 files changed

+61
-57
lines changed

4 files changed

+61
-57
lines changed

jest.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
module.exports = {
4-
testURL: 'http://localhost/',
54
collectCoverage: false,
65
coveragePathIgnorePatterns: ['test'],
76
moduleFileExtensions: ['js', 'json'],

package-lock.json

+49-49
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@
4848
"@commitlint/config-conventional": "^8.3.4",
4949
"@webpack-contrib/defaults": "^6.3.0",
5050
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
51-
"babel-jest": "^25.2.1",
51+
"babel-jest": "^25.2.6",
5252
"commitlint-azure-pipelines-cli": "^1.0.3",
5353
"cross-env": "^7.0.2",
5454
"del": "^5.1.0",
5555
"del-cli": "^3.0.0",
5656
"eslint": "^6.8.0",
5757
"eslint-config-prettier": "^6.10.1",
58-
"eslint-plugin-import": "^2.20.1",
58+
"eslint-plugin-import": "^2.20.2",
5959
"eslint-plugin-prettier": "^3.1.2",
6060
"express": "^4.17.1",
6161
"file-loader": "^6.0.0",

test/middleware.test.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -775,11 +775,16 @@ describe('middleware', () => {
775775
for (const { value, contentType, code } of urls) {
776776
// eslint-disable-next-line no-loop-func
777777
it(`should return the "${code}" code for the "GET" request for the "${value}" url`, (done) => {
778-
request(app)
779-
.get(`${publicPathForRequest}${value}`)
780-
.expect('Content-Type', contentType)
781-
.expect('Content-Length', data ? String(data.length) : /\d+/)
782-
.expect(code, done);
778+
setImmediate(() => {
779+
request(app)
780+
.get(`${publicPathForRequest}${value}`)
781+
.expect('Content-Type', contentType)
782+
.expect(
783+
'Content-Length',
784+
data ? String(data.length) : /\d+/
785+
)
786+
.expect(code, done);
787+
});
783788
});
784789
}
785790
}

0 commit comments

Comments
 (0)