Skip to content

Commit d21982c

Browse files
committed
fixup! module: add clearCache for CJS and ESM
1 parent e2a581d commit d21982c

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

test/es-module/test-module-clear-cache-wasm-leak.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Flags: --no-warnings
22

3-
import { mustCall } from '../common/index.mjs';
3+
import { mustCall, mustCallAtLeast } from '../common/index.mjs';
44
import assert from 'node:assert';
55
import { clearCache, createRequire } from 'node:module';
66

@@ -12,7 +12,7 @@ const baseUrl = new URL('../fixtures/simple.wasm', import.meta.url);
1212
const outer = 8;
1313
const inner = 4;
1414

15-
const runIteration = mustCall(async (i) => {
15+
const runIteration = mustCallAtLeast(async (i) => {
1616
for (let j = 0; j < inner; j++) {
1717
const url = new URL(baseUrl);
1818
url.search = `?v=${i}-${j}`;
@@ -21,6 +21,6 @@ const runIteration = mustCall(async (i) => {
2121
clearCache(url);
2222
}
2323
return inner;
24-
}, outer);
24+
});
2525

2626
checkIfCollectableByCounting(runIteration, WebAssembly.Instance, outer).then(mustCall());

test/es-module/test-module-clear-cache-wasm.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Flags: --no-warnings
22

3+
import '../common/index.mjs';
34
import assert from 'node:assert';
45
import { clearCache } from 'node:module';
56

0 commit comments

Comments
 (0)