Skip to content

Commit

Permalink
Experiment with running pending promise handlers after each test to s…
Browse files Browse the repository at this point in the history
…ee if it makes a difference in console output
  • Loading branch information
karanbirsingh committed Jan 14, 2022
1 parent f4bc238 commit c24cf0f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/tests/unit/jest-setup-after-env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

afterEach(async () => {
try {
await new Promise(process.nextTick);
} catch (e) {
console.log(e);
}
});
1 change: 1 addition & 0 deletions src/tests/unit/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = {
rootDir: rootDir,
roots: [currentDir],
setupFiles: [`${currentDir}/jest-setup.ts`],
setupFilesAfterEnv: [`${currentDir}/jest-setup-after-env.ts`],
testEnvironment: 'jsdom',
testMatch: [`${currentDir}/**/*.test.(ts|tsx|js)`],
};

0 comments on commit c24cf0f

Please sign in to comment.