Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

fix(test): suppress jest require cache warning #39

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/e2e/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ function configForTestSuite(suite: JestSuite) {
}
}

declare var jest : never;
function purgeRequireCache(files: string[]) {
// Jest returns an annoying warning if we try to purge the cache
// while being tested.
if (typeof jest !== 'undefined')
return;
const blackList = new Set(files);
for (const filePath of Object.keys(require.cache)) {
/** @type {NodeModule|null|undefined} */
Expand Down