Debian Codegraph @

ncjsm/test/require-uncached.js

raw
1 "use strict";
2
3 module.exports = function (t, a) {
4 const pathA = "./__playground/other"
5 , pathB = "./__playground/samename"
6 , moduleA = require(pathA);
7
8 let moduleA2;
9
10 const innerModuleB = t([require.resolve(pathA), require.resolve(pathB)], () => {
11 moduleA2 = require(pathA);
12 a.not(moduleA2, moduleA);
13 return require(pathB);
14 });
15
16 const moduleB = require(pathB);
17 a(require(pathA), moduleA);
18 a.not(moduleB, innerModuleB);
19
20 t([require.resolve(pathA), require.resolve(pathB)], () => {
21 const moduleA3 = require(pathA);
22 a.not(moduleA3, moduleA);
23 a.not(moduleA3, moduleA2);
24 const moduleB3 = require(pathB);
25 a.not(moduleB3, moduleB);
26 });
27
28 a(require(pathA), moduleA);
29 a(require(pathB), moduleB);
30
31 t(() => {
32 const moduleA3 = require(pathA);
33 a.not(moduleA3, moduleA);
34 a.not(moduleA3, moduleA2);
35 const moduleB3 = require(pathB);
36 a.not(moduleB3, moduleB);
37 });
38 };