MCPcopy Index your code
hub / github.com/nodejs/node / run

Function run

test/parallel/test-source-map-cjs-require-cache.js:17–26  ·  view source on GitHub ↗
(moduleId)

Source from the content-addressed store, hash-verified

15const moduleIdRepeat = require.resolve('../fixtures/source-map/no-throw2.js');
16
17function run(moduleId) {
18 require(moduleId);
19 delete require.cache[moduleId];
20 const idx = module.children.findIndex((child) => child.id === moduleId);
21 assert.ok(idx >= 0);
22 module.children.splice(idx, 1);
23
24 // Verify that the source map is still available
25 assert.notStrictEqual(findSourceMap(moduleId), undefined);
26}
27
28// Run the test in a function scope so that every variable can be reclaimed by GC.
29run(moduleId);

Calls 3

findSourceMapFunction · 0.85
requireFunction · 0.50
okMethod · 0.45

Tested by

no test coverage detected