Skip to content

Commit

Permalink
test: fix tests failing in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jtassin committed Aug 28, 2019
1 parent 5fc4c3b commit d104c21
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
setupFilesAfterEnv: ['./jest.setup.ts'],
collectCoverageFrom: [
'src/*.{js,jsx}',
'!**/node_modules/**',
Expand Down
1 change: 1 addition & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jest.setTimeout(20e3);
4 changes: 2 additions & 2 deletions src/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ describe('PendingXHR', () => {
setTimeout(() => {
request1Resolver([200, 'first xhr finished']);
});
await sleep(10);
await sleep(1000);
expect(pendingXHR.pendingXhrCount()).toEqual(1);
setTimeout(() => {
request2Resolver([200, 'second xhr finished']);
});
await sleep(10);
await sleep(1000);
expect(pendingXHR.pendingXhrCount()).toEqual(0);
});
});
Expand Down

0 comments on commit d104c21

Please sign in to comment.