Skip to content

Commit

Permalink
test(middleware): use setImmediate for MacOS CI
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroppy committed Apr 3, 2020
1 parent 8c2d686 commit cbb48a0
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 57 deletions.
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

module.exports = {
testURL: 'http://localhost/',
collectCoverage: false,
coveragePathIgnorePatterns: ['test'],
moduleFileExtensions: ['js', 'json'],
Expand Down
98 changes: 49 additions & 49 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
"@commitlint/config-conventional": "^8.3.4",
"@webpack-contrib/defaults": "^6.3.0",
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
"babel-jest": "^25.2.1",
"babel-jest": "^25.2.6",
"commitlint-azure-pipelines-cli": "^1.0.3",
"cross-env": "^7.0.2",
"del": "^5.1.0",
"del-cli": "^3.0.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-prettier": "^3.1.2",
"express": "^4.17.1",
"file-loader": "^6.0.0",
Expand Down
15 changes: 10 additions & 5 deletions test/middleware.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,11 +775,16 @@ describe('middleware', () => {
for (const { value, contentType, code } of urls) {
// eslint-disable-next-line no-loop-func
it(`should return the "${code}" code for the "GET" request for the "${value}" url`, (done) => {
request(app)
.get(`${publicPathForRequest}${value}`)
.expect('Content-Type', contentType)
.expect('Content-Length', data ? String(data.length) : /\d+/)
.expect(code, done);
setTimeout(() => {
request(app)
.get(`${publicPathForRequest}${value}`)
.expect('Content-Type', contentType)
.expect(
'Content-Length',
data ? String(data.length) : /\d+/
)
.expect(code, done);
});
});
}
}
Expand Down

0 comments on commit cbb48a0

Please sign in to comment.