Skip to content

Commit

Permalink
test: add useRealTimers for flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
Leeyoungone committed Mar 25, 2022
1 parent 62a7c63 commit 3628838
Showing 1 changed file with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const testCase = "can import plugins at runtime (CLI)";
describe(testCase, () => {
let apiServer: ApiServer;

beforeAll(() => {
jest.resetModules();
afterEach(() => {
jest.useRealTimers();
});

test(testCase, async () => {
Expand Down Expand Up @@ -75,18 +75,5 @@ describe(testCase, () => {
});
afterAll(async () => {
await apiServer.shutdown();
// nodeCleanup(test, (exitCode: unknown) => {
// if (exitCode == 0) {
// console.log("gets into the first if statement");
// afterAll(async () => {
// await apiServer.shutdown();
// });
// } else {
// console.log("gets into the second if statement");
// afterAll(async () => {
// await apiServer.shutdown();
// });
// }
// });
});
});

0 comments on commit 3628838

Please sign in to comment.