@rspack/test-tools 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/case/builtin.js +106 -66
- package/dist/case/cache.js +136 -122
- package/dist/case/common.d.ts +4 -4
- package/dist/case/common.js +162 -157
- package/dist/case/compiler.d.ts +4 -4
- package/dist/case/compiler.js +75 -64
- package/dist/case/config.js +112 -74
- package/dist/case/defaults.js +136 -83
- package/dist/case/diagnostic.js +112 -84
- package/dist/case/error.d.ts +4 -4
- package/dist/case/error.js +105 -89
- package/dist/case/esm-output.js +118 -87
- package/dist/case/example.js +73 -35
- package/dist/case/hash.js +74 -59
- package/dist/case/hook.js +151 -138
- package/dist/case/hot-step.js +130 -161
- package/dist/case/hot.js +148 -134
- package/dist/case/incremental.js +91 -58
- package/dist/case/index.js +134 -51
- package/dist/case/multi-compiler.d.ts +4 -4
- package/dist/case/multi-compiler.js +81 -56
- package/dist/case/native-watcher.js +62 -30
- package/dist/case/normal.js +253 -185
- package/dist/case/runner.js +80 -51
- package/dist/case/serial.js +47 -16
- package/dist/case/stats-api.d.ts +4 -4
- package/dist/case/stats-api.js +63 -43
- package/dist/case/stats-output.d.ts +3 -3
- package/dist/case/stats-output.js +147 -152
- package/dist/case/treeshaking.js +66 -35
- package/dist/case/watch.d.ts +3 -19
- package/dist/case/watch.js +204 -224
- package/dist/compiler.js +222 -195
- package/dist/helper/directory.js +83 -71
- package/dist/helper/disable-iconv-lite-warning.js +35 -9
- package/dist/helper/expect/diff.js +39 -10
- package/dist/helper/expect/error.js +62 -30
- package/dist/helper/expect/placeholder.js +47 -21
- package/dist/helper/expect/rspack.js +35 -13
- package/dist/helper/expect/to-be-typeof.js +39 -7
- package/dist/helper/expect/to-end-with.js +40 -8
- package/dist/helper/expect/to-match-file-snapshot.js +103 -80
- package/dist/helper/hot-update/index.js +35 -4
- package/dist/helper/hot-update/loader.d.ts +1 -0
- package/dist/helper/hot-update/loader.js +39 -4
- package/dist/helper/hot-update/plugin.d.ts +1 -1
- package/dist/helper/hot-update/plugin.js +87 -74
- package/dist/helper/index.js +138 -24
- package/dist/helper/is.js +51 -10
- package/dist/helper/legacy/EventSourceForNode.d.ts +11 -3
- package/dist/helper/legacy/EventSourceForNode.js +83 -37
- package/dist/helper/legacy/LogTestPlugin.d.ts +2 -3
- package/dist/helper/legacy/LogTestPlugin.js +39 -6
- package/dist/helper/legacy/asModule.d.ts +3 -3
- package/dist/helper/legacy/asModule.js +68 -19
- package/dist/helper/legacy/captureStdio.d.ts +1 -2
- package/dist/helper/legacy/captureStdio.js +69 -29
- package/dist/helper/legacy/checkArrayExpectation.d.ts +1 -2
- package/dist/helper/legacy/checkArrayExpectation.js +132 -121
- package/dist/helper/legacy/copyDiff.d.ts +1 -2
- package/dist/helper/legacy/copyDiff.js +86 -42
- package/dist/helper/legacy/createFakeWorker.d.ts +2 -3
- package/dist/helper/legacy/createFakeWorker.js +90 -47
- package/dist/helper/legacy/createLazyTestEnv.d.ts +2 -3
- package/dist/helper/legacy/createLazyTestEnv.js +70 -59
- package/dist/helper/legacy/currentScript.d.ts +2 -2
- package/dist/helper/legacy/currentScript.js +35 -2
- package/dist/helper/legacy/deprecationTracking.d.ts +1 -1
- package/dist/helper/legacy/deprecationTracking.js +53 -28
- package/dist/helper/legacy/expectSource.d.ts +3 -2
- package/dist/helper/legacy/expectSource.js +42 -18
- package/dist/helper/legacy/fakeSystem.d.ts +12 -9
- package/dist/helper/legacy/fakeSystem.js +68 -58
- package/dist/helper/legacy/findOutputFiles.d.ts +7 -2
- package/dist/helper/legacy/findOutputFiles.js +60 -13
- package/dist/helper/legacy/parseResource.d.ts +1 -1
- package/dist/helper/legacy/parseResource.js +36 -6
- package/dist/helper/legacy/regexEscape.d.ts +1 -2
- package/dist/helper/legacy/regexEscape.js +39 -5
- package/dist/helper/legacy/supportDefaultAssignment.d.ts +1 -2
- package/dist/helper/legacy/supportDefaultAssignment.js +40 -7
- package/dist/helper/legacy/supportsTextDecoder.d.ts +1 -2
- package/dist/helper/legacy/supportsTextDecoder.js +40 -6
- package/dist/helper/legacy/supportsUsing.d.ts +1 -2
- package/dist/helper/legacy/supportsUsing.js +40 -7
- package/dist/helper/legacy/urlToRelativePath.d.ts +2 -2
- package/dist/helper/legacy/urlToRelativePath.js +56 -7
- package/dist/helper/parse-modules.js +52 -42
- package/dist/helper/read-config-file.js +60 -18
- package/dist/helper/serializers.js +62 -33
- package/dist/helper/setup-env.js +81 -91
- package/dist/helper/setup-expect.js +13 -13
- package/dist/helper/setup-wasm.js +18 -9
- package/dist/helper/stringify-config.js +44 -26
- package/dist/helper/update-snapshot.js +35 -3
- package/dist/helper/util/checkSourceMap.js +119 -80
- package/dist/helper/util/checkStats.d.ts +1 -1
- package/dist/helper/util/checkStats.js +42 -17
- package/dist/helper/util/expectWarningFactory.d.ts +1 -2
- package/dist/helper/util/expectWarningFactory.js +41 -8
- package/dist/helper/util/filterUtil.d.ts +9 -8
- package/dist/helper/util/filterUtil.js +63 -23
- package/dist/helper/win.js +46 -7
- package/dist/index.js +115 -23
- package/dist/plugin/index.js +55 -14
- package/dist/plugin/lazy-compilation-test-plugin.js +55 -41
- package/dist/reporter/index.js +55 -14
- package/dist/reporter/streamed-events-reporter.js +51 -77
- package/dist/runner/index.js +62 -15
- package/dist/runner/node/index.js +365 -431
- package/dist/runner/web/index.js +278 -263
- package/dist/test/context.js +67 -41
- package/dist/test/creator.js +135 -167
- package/dist/test/debug.js +89 -58
- package/dist/test/tester.js +94 -74
- package/dist/type.d.ts +10 -9
- package/dist/type.js +43 -9
- package/package.json +21 -20
|
@@ -1,471 +1,405 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"@rspack/test-tools" (module) {
|
|
4
|
+
module.exports = require("@rspack/test-tools");
|
|
7
5
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
6
|
+
};
|
|
7
|
+
var __webpack_module_cache__ = {};
|
|
8
|
+
function __webpack_require__(moduleId) {
|
|
9
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
10
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
11
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
12
|
+
exports: {}
|
|
26
13
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
14
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
15
|
+
return module.exports;
|
|
16
|
+
}
|
|
17
|
+
(()=>{
|
|
18
|
+
__webpack_require__.n = (module)=>{
|
|
19
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
20
|
+
__webpack_require__.d(getter, {
|
|
21
|
+
a: getter
|
|
22
|
+
});
|
|
23
|
+
return getter;
|
|
33
24
|
};
|
|
34
25
|
})();
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
26
|
+
(()=>{
|
|
27
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
28
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: definition[key]
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
})();
|
|
34
|
+
(()=>{
|
|
35
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
36
|
+
})();
|
|
37
|
+
(()=>{
|
|
38
|
+
__webpack_require__.r = (exports1)=>{
|
|
39
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
40
|
+
value: 'Module'
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
43
|
+
value: true
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
var __webpack_exports__ = {};
|
|
48
|
+
(()=>{
|
|
49
|
+
__webpack_require__.r(__webpack_exports__);
|
|
50
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
51
|
+
NodeRunner: ()=>NodeRunner
|
|
52
|
+
});
|
|
53
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
54
|
+
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
55
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
56
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
57
|
+
const external_node_url_namespaceObject = require("node:url");
|
|
58
|
+
const external_node_vm_namespaceObject = require("node:vm");
|
|
59
|
+
var external_node_vm_default = /*#__PURE__*/ __webpack_require__.n(external_node_vm_namespaceObject);
|
|
60
|
+
const config_js_namespaceObject = require("../../case/config.js");
|
|
61
|
+
const asModule_js_namespaceObject = require("../../helper/legacy/asModule.js");
|
|
62
|
+
const createFakeWorker_js_namespaceObject = require("../../helper/legacy/createFakeWorker.js");
|
|
63
|
+
const urlToRelativePath_js_namespaceObject = require("../../helper/legacy/urlToRelativePath.js");
|
|
64
|
+
const external_type_js_namespaceObject = require("../../type.js");
|
|
65
|
+
const isRelativePath = (p)=>/^\.\.?\//.test(p);
|
|
66
|
+
const getSubPath = (p)=>{
|
|
67
|
+
const lastSlash = p.lastIndexOf('/');
|
|
68
|
+
let firstSlash = p.indexOf('/');
|
|
69
|
+
if (-1 !== lastSlash && firstSlash !== lastSlash) {
|
|
70
|
+
if (-1 !== firstSlash) {
|
|
71
|
+
let next = p.indexOf('/', firstSlash + 1);
|
|
72
|
+
let dir = p.slice(firstSlash + 1, next);
|
|
73
|
+
while('.' === dir){
|
|
74
|
+
firstSlash = next;
|
|
75
|
+
next = p.indexOf('/', firstSlash + 1);
|
|
76
|
+
dir = p.slice(firstSlash + 1, next);
|
|
77
|
+
}
|
|
61
78
|
}
|
|
79
|
+
return p.slice(firstSlash + 1, lastSlash + 1);
|
|
62
80
|
}
|
|
63
|
-
return
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
this.requirers = new Map();
|
|
75
|
-
}
|
|
76
|
-
log(message) {
|
|
77
|
-
this._options.logs?.push(`[NodeRunner] ${message}`);
|
|
78
|
-
}
|
|
79
|
-
run(file) {
|
|
80
|
-
if (!this.globalContext) {
|
|
81
|
-
this.globalContext = this.createGlobalContext();
|
|
81
|
+
return '';
|
|
82
|
+
};
|
|
83
|
+
const cached = new Map();
|
|
84
|
+
class NodeRunner {
|
|
85
|
+
_options;
|
|
86
|
+
requireCache = Object.create(null);
|
|
87
|
+
globalContext = null;
|
|
88
|
+
baseModuleScope = null;
|
|
89
|
+
requirers = new Map();
|
|
90
|
+
constructor(_options){
|
|
91
|
+
this._options = _options;
|
|
82
92
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
this._options.testConfig.moduleScope(this.baseModuleScope, this._options.stats, this._options.compilerOptions);
|
|
93
|
+
log(message) {
|
|
94
|
+
this._options.logs?.push(`[NodeRunner] ${message}`);
|
|
86
95
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
: `./${file}`);
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
run(file) {
|
|
97
|
+
if (!this.globalContext) this.globalContext = this.createGlobalContext();
|
|
98
|
+
this.baseModuleScope = this.createBaseModuleScope();
|
|
99
|
+
if ('function' == typeof this._options.testConfig.moduleScope) this._options.testConfig.moduleScope(this.baseModuleScope, this._options.stats, this._options.compilerOptions);
|
|
100
|
+
this.createRunner();
|
|
101
|
+
const res = this.getRequire()(external_node_path_default().isAbsolute(file) ? external_node_path_default().dirname(file) : this._options.dist, file.startsWith('./') || file.startsWith('https://test.cases/') || external_node_path_default().isAbsolute(file) ? file : `./${file}`);
|
|
102
|
+
if (this.globalContext.WAITING.length) return Promise.all(this.globalContext.WAITING).then(()=>res);
|
|
103
|
+
if ('object' == typeof res && 'then' in res) return res;
|
|
104
|
+
return Promise.resolve(res);
|
|
95
105
|
}
|
|
96
|
-
|
|
97
|
-
|
|
106
|
+
getRequire() {
|
|
107
|
+
const entryRequire = this.requirers.get('entry');
|
|
108
|
+
const runner = this;
|
|
109
|
+
return function(currentDirectory, modulePath, context = {}) {
|
|
110
|
+
const from = this?.from;
|
|
111
|
+
if (from) runner.log(`require: ${modulePath} from ${from}`);
|
|
112
|
+
else runner.log(`require: ${modulePath}`);
|
|
113
|
+
const p = Array.isArray(modulePath) ? modulePath : modulePath.split('?')[0];
|
|
114
|
+
return entryRequire(currentDirectory, p, context);
|
|
115
|
+
};
|
|
98
116
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
},
|
|
129
|
-
warn: (...args) => {
|
|
130
|
-
if (printLogger) {
|
|
131
|
-
console.warn(...args);
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
error: (...args) => {
|
|
135
|
-
console.error(...args);
|
|
136
|
-
},
|
|
137
|
-
info: (...args) => {
|
|
138
|
-
if (printLogger) {
|
|
139
|
-
console.info(...args);
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
debug: (...args) => {
|
|
143
|
-
if (printLogger) {
|
|
144
|
-
console.info(...args);
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
trace: (...args) => {
|
|
148
|
-
if (printLogger) {
|
|
149
|
-
console.info(...args);
|
|
117
|
+
getGlobal(name) {
|
|
118
|
+
return (this.globalContext || {})[name];
|
|
119
|
+
}
|
|
120
|
+
createGlobalContext() {
|
|
121
|
+
return {
|
|
122
|
+
console: {
|
|
123
|
+
log: (...args)=>{
|
|
124
|
+
if (printLogger) console.log(...args);
|
|
125
|
+
},
|
|
126
|
+
warn: (...args)=>{
|
|
127
|
+
if (printLogger) console.warn(...args);
|
|
128
|
+
},
|
|
129
|
+
error: (...args)=>{
|
|
130
|
+
console.error(...args);
|
|
131
|
+
},
|
|
132
|
+
info: (...args)=>{
|
|
133
|
+
if (printLogger) console.info(...args);
|
|
134
|
+
},
|
|
135
|
+
debug: (...args)=>{
|
|
136
|
+
if (printLogger) console.info(...args);
|
|
137
|
+
},
|
|
138
|
+
trace: (...args)=>{
|
|
139
|
+
if (printLogger) console.info(...args);
|
|
140
|
+
},
|
|
141
|
+
assert: (...args)=>{
|
|
142
|
+
console.assert(...args);
|
|
143
|
+
},
|
|
144
|
+
clear: ()=>{
|
|
145
|
+
console.clear();
|
|
150
146
|
}
|
|
151
147
|
},
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
148
|
+
WAITING: [],
|
|
149
|
+
setTimeout: (cb, ms, ...args)=>{
|
|
150
|
+
const timeout = setTimeout(cb, ms, ...args);
|
|
151
|
+
timeout.unref();
|
|
152
|
+
return timeout;
|
|
157
153
|
},
|
|
158
|
-
|
|
159
|
-
WAITING: [],
|
|
160
|
-
setTimeout: ((cb, ms, ...args) => {
|
|
161
|
-
const timeout = setTimeout(cb, ms, ...args);
|
|
162
|
-
timeout.unref();
|
|
163
|
-
return timeout;
|
|
164
|
-
}),
|
|
165
|
-
clearTimeout: clearTimeout,
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
createBaseModuleScope() {
|
|
169
|
-
const baseModuleScope = {
|
|
170
|
-
console: this.globalContext.console,
|
|
171
|
-
setTimeout: this.globalContext.setTimeout,
|
|
172
|
-
clearTimeout: this.globalContext.clearTimeout,
|
|
173
|
-
nsObj: (m) => {
|
|
174
|
-
Object.defineProperty(m, Symbol.toStringTag, {
|
|
175
|
-
value: 'Module',
|
|
176
|
-
});
|
|
177
|
-
return m;
|
|
178
|
-
},
|
|
179
|
-
WAITING: this.globalContext.WAITING,
|
|
180
|
-
process,
|
|
181
|
-
TextDecoder,
|
|
182
|
-
URL,
|
|
183
|
-
Blob,
|
|
184
|
-
Symbol,
|
|
185
|
-
Buffer,
|
|
186
|
-
setImmediate,
|
|
187
|
-
self: this.globalContext,
|
|
188
|
-
__TEST_PATH__: __TEST_PATH__,
|
|
189
|
-
__TEST_SOURCE_PATH__: this._options.source,
|
|
190
|
-
__TEST_DIST_PATH__: this._options.dist,
|
|
191
|
-
__MODE__: this._options.compilerOptions.mode,
|
|
192
|
-
__SNAPSHOT__: node_path_1.default.join(this._options.source, '__snapshot__'),
|
|
193
|
-
Worker: (0, createFakeWorker_1.default)(this._options.env, {
|
|
194
|
-
outputDirectory: this._options.dist,
|
|
195
|
-
}),
|
|
196
|
-
...this._options.env,
|
|
197
|
-
};
|
|
198
|
-
return baseModuleScope;
|
|
199
|
-
}
|
|
200
|
-
createModuleScope(requireFn, m, file) {
|
|
201
|
-
const requirer = requireFn.bind({
|
|
202
|
-
from: file.path,
|
|
203
|
-
module: m,
|
|
204
|
-
}, node_path_1.default.dirname(file.path));
|
|
205
|
-
requirer.webpackTestSuiteRequire = true;
|
|
206
|
-
return {
|
|
207
|
-
...this.baseModuleScope,
|
|
208
|
-
require: requirer,
|
|
209
|
-
module: m,
|
|
210
|
-
exports: m.exports,
|
|
211
|
-
__dirname: node_path_1.default.dirname(file.path),
|
|
212
|
-
__filename: file.path,
|
|
213
|
-
_globalAssign: {
|
|
214
|
-
expect: this._options.env.expect,
|
|
215
|
-
},
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
getFile(modulePath, currentDirectory) {
|
|
219
|
-
const cacheKey = `${currentDirectory}|${modulePath}`;
|
|
220
|
-
if (this._options.cachable && cached.has(cacheKey)) {
|
|
221
|
-
return cached.get(cacheKey);
|
|
222
|
-
}
|
|
223
|
-
let res = null;
|
|
224
|
-
if (Array.isArray(modulePath)) {
|
|
225
|
-
res = {
|
|
226
|
-
path: node_path_1.default.join(currentDirectory, '.array-require.js'),
|
|
227
|
-
content: `module.exports = (${modulePath
|
|
228
|
-
.map((arg) => {
|
|
229
|
-
return `require(${JSON.stringify(`./${arg}`)})`;
|
|
230
|
-
})
|
|
231
|
-
.join(', ')});`,
|
|
232
|
-
subPath: '',
|
|
154
|
+
clearTimeout: clearTimeout
|
|
233
155
|
};
|
|
234
156
|
}
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
157
|
+
createBaseModuleScope() {
|
|
158
|
+
const baseModuleScope = {
|
|
159
|
+
console: this.globalContext.console,
|
|
160
|
+
setTimeout: this.globalContext.setTimeout,
|
|
161
|
+
clearTimeout: this.globalContext.clearTimeout,
|
|
162
|
+
nsObj: (m)=>{
|
|
163
|
+
Object.defineProperty(m, Symbol.toStringTag, {
|
|
164
|
+
value: 'Module'
|
|
165
|
+
});
|
|
166
|
+
return m;
|
|
167
|
+
},
|
|
168
|
+
WAITING: this.globalContext.WAITING,
|
|
169
|
+
process,
|
|
170
|
+
TextDecoder,
|
|
171
|
+
URL,
|
|
172
|
+
Blob,
|
|
173
|
+
Symbol,
|
|
174
|
+
Buffer,
|
|
175
|
+
setImmediate,
|
|
176
|
+
self: this.globalContext,
|
|
177
|
+
__TEST_PATH__: __TEST_PATH__,
|
|
178
|
+
__TEST_SOURCE_PATH__: this._options.source,
|
|
179
|
+
__TEST_DIST_PATH__: this._options.dist,
|
|
180
|
+
__MODE__: this._options.compilerOptions.mode,
|
|
181
|
+
__SNAPSHOT__: external_node_path_default().join(this._options.source, '__snapshot__'),
|
|
182
|
+
Worker: (0, createFakeWorker_js_namespaceObject.createFakeWorker)(this._options.env, {
|
|
183
|
+
outputDirectory: this._options.dist
|
|
184
|
+
}),
|
|
185
|
+
...this._options.env
|
|
242
186
|
};
|
|
187
|
+
return baseModuleScope;
|
|
243
188
|
}
|
|
244
|
-
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
189
|
+
createModuleScope(requireFn, m, file) {
|
|
190
|
+
const requirer = requireFn.bind({
|
|
191
|
+
from: file.path,
|
|
192
|
+
module: m
|
|
193
|
+
}, external_node_path_default().dirname(file.path));
|
|
194
|
+
requirer.webpackTestSuiteRequire = true;
|
|
195
|
+
return {
|
|
196
|
+
...this.baseModuleScope,
|
|
197
|
+
require: requirer,
|
|
198
|
+
module: m,
|
|
199
|
+
exports: m.exports,
|
|
200
|
+
__dirname: external_node_path_default().dirname(file.path),
|
|
201
|
+
__filename: file.path,
|
|
202
|
+
_globalAssign: {
|
|
203
|
+
expect: this._options.env.expect
|
|
204
|
+
}
|
|
250
205
|
};
|
|
251
206
|
}
|
|
252
|
-
|
|
253
|
-
|
|
207
|
+
getFile(modulePath, currentDirectory) {
|
|
208
|
+
const cacheKey = `${currentDirectory}|${modulePath}`;
|
|
209
|
+
if (this._options.cachable && cached.has(cacheKey)) return cached.get(cacheKey);
|
|
210
|
+
let res = null;
|
|
211
|
+
if (Array.isArray(modulePath)) res = {
|
|
212
|
+
path: external_node_path_default().join(currentDirectory, '.array-require.js'),
|
|
213
|
+
content: `module.exports = (${modulePath.map((arg)=>`require(${JSON.stringify(`./${arg}`)})`).join(', ')});`,
|
|
214
|
+
subPath: ''
|
|
215
|
+
};
|
|
216
|
+
else if (modulePath.startsWith('https://test.cases/')) {
|
|
217
|
+
const relativePath = (0, urlToRelativePath_js_namespaceObject.urlToRelativePath)(modulePath);
|
|
218
|
+
const absPath = external_node_path_default().join(currentDirectory, relativePath);
|
|
219
|
+
res = {
|
|
220
|
+
path: absPath,
|
|
221
|
+
content: external_node_fs_default().readFileSync(absPath, 'utf-8'),
|
|
222
|
+
subPath: ''
|
|
223
|
+
};
|
|
224
|
+
} else if (isRelativePath(modulePath)) {
|
|
225
|
+
const p = external_node_path_default().join(currentDirectory, modulePath);
|
|
226
|
+
res = {
|
|
227
|
+
path: p,
|
|
228
|
+
content: external_node_fs_default().readFileSync(p, 'utf-8'),
|
|
229
|
+
subPath: getSubPath(modulePath)
|
|
230
|
+
};
|
|
231
|
+
} else if (external_node_path_default().isAbsolute(modulePath)) res = {
|
|
254
232
|
path: modulePath,
|
|
255
|
-
content:
|
|
256
|
-
subPath: 'absolute_path'
|
|
233
|
+
content: external_node_fs_default().readFileSync(modulePath, 'utf-8'),
|
|
234
|
+
subPath: 'absolute_path'
|
|
257
235
|
};
|
|
236
|
+
if (this._options.cachable && res) cached.set(cacheKey, res);
|
|
237
|
+
return res;
|
|
258
238
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
this.requirers.set('entry', (currentDirectory, modulePath, context) => {
|
|
272
|
-
const file = this.getFile(modulePath, currentDirectory);
|
|
273
|
-
this.log(`entry: ${modulePath} -> ${file?.path}`);
|
|
274
|
-
if (!file) {
|
|
275
|
-
return this.requirers.get('miss')(currentDirectory, modulePath);
|
|
276
|
-
}
|
|
277
|
-
if (file.path.endsWith('.json')) {
|
|
278
|
-
return this.requirers.get('json')(currentDirectory, modulePath, {
|
|
239
|
+
preExecute(code, file) {}
|
|
240
|
+
postExecute(m, file) {}
|
|
241
|
+
createRunner() {
|
|
242
|
+
this.requirers.set('cjs', this.createCjsRequirer());
|
|
243
|
+
this.requirers.set('esm', this.createEsmRequirer());
|
|
244
|
+
this.requirers.set('miss', this.createMissRequirer());
|
|
245
|
+
this.requirers.set('json', this.createJsonRequirer());
|
|
246
|
+
this.requirers.set('entry', (currentDirectory, modulePath, context)=>{
|
|
247
|
+
const file = this.getFile(modulePath, currentDirectory);
|
|
248
|
+
this.log(`entry: ${modulePath} -> ${file?.path}`);
|
|
249
|
+
if (!file) return this.requirers.get('miss')(currentDirectory, modulePath);
|
|
250
|
+
if (file.path.endsWith('.json')) return this.requirers.get('json')(currentDirectory, modulePath, {
|
|
279
251
|
...context,
|
|
280
|
-
file
|
|
252
|
+
file
|
|
281
253
|
});
|
|
282
|
-
|
|
283
|
-
if (file.path.endsWith('.mjs') ||
|
|
284
|
-
(0, config_1.enableEsmLibraryPlugin)(this._options.compilerOptions)) {
|
|
285
|
-
return this.requirers.get('esm')(currentDirectory, modulePath, {
|
|
254
|
+
if (file.path.endsWith('.mjs') || (0, config_js_namespaceObject.enableEsmLibraryPlugin)(this._options.compilerOptions)) return this.requirers.get('esm')(currentDirectory, modulePath, {
|
|
286
255
|
...context,
|
|
287
|
-
file
|
|
256
|
+
file
|
|
257
|
+
});
|
|
258
|
+
return this.requirers.get('cjs')(currentDirectory, modulePath, {
|
|
259
|
+
...context,
|
|
260
|
+
file
|
|
288
261
|
});
|
|
289
|
-
}
|
|
290
|
-
return this.requirers.get('cjs')(currentDirectory, modulePath, {
|
|
291
|
-
...context,
|
|
292
|
-
file,
|
|
293
262
|
});
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
return require(modulePathStr.startsWith('node:')
|
|
307
|
-
? modulePathStr.slice(5)
|
|
308
|
-
: modulePathStr);
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
createJsonRequirer() {
|
|
312
|
-
return (currentDirectory, modulePath, context = {}) => {
|
|
313
|
-
if (Array.isArray(modulePath)) {
|
|
314
|
-
throw new Error('Array module path is not supported in hot cases');
|
|
315
|
-
}
|
|
316
|
-
const file = context.file || this.getFile(modulePath, currentDirectory);
|
|
317
|
-
this.log(`json: ${modulePath} -> ${file?.path}`);
|
|
318
|
-
if (!file) {
|
|
319
|
-
return this.requirers.get('miss')(currentDirectory, modulePath);
|
|
320
|
-
}
|
|
321
|
-
return JSON.parse(node_fs_1.default.readFileSync(node_path_1.default.join(this._options.dist, modulePath), 'utf-8'));
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
createCjsRequirer() {
|
|
325
|
-
return (currentDirectory, modulePath, context = {}) => {
|
|
326
|
-
if (modulePath === '@rspack/test-tools') {
|
|
327
|
-
return require('@rspack/test-tools');
|
|
328
|
-
}
|
|
329
|
-
const file = context.file || this.getFile(modulePath, currentDirectory);
|
|
330
|
-
this.log(`cjs: ${modulePath} -> ${file?.path}`);
|
|
331
|
-
if (!file) {
|
|
332
|
-
return this.requirers.get('miss')(currentDirectory, modulePath);
|
|
333
|
-
}
|
|
334
|
-
if (file.path in this.requireCache) {
|
|
335
|
-
this.log(`cjs cache hit: ${file.path}`);
|
|
336
|
-
return this.requireCache[file.path].exports;
|
|
337
|
-
}
|
|
338
|
-
const m = {
|
|
339
|
-
exports: {},
|
|
340
|
-
webpackTestSuiteModule: true,
|
|
263
|
+
}
|
|
264
|
+
createMissRequirer() {
|
|
265
|
+
return (currentDirectory, modulePath, context = {})=>{
|
|
266
|
+
this.log(`missing: ${modulePath}`);
|
|
267
|
+
const modulePathStr = modulePath;
|
|
268
|
+
const modules = this._options.testConfig.modules;
|
|
269
|
+
if (modules && modulePathStr in modules) {
|
|
270
|
+
this.log(`mock module: ${modulePathStr}`);
|
|
271
|
+
return modules[modulePathStr];
|
|
272
|
+
}
|
|
273
|
+
this.log(`native require: ${modulePathStr}`);
|
|
274
|
+
return require(modulePathStr.startsWith('node:') ? modulePathStr.slice(5) : modulePathStr);
|
|
341
275
|
};
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
276
|
+
}
|
|
277
|
+
createJsonRequirer() {
|
|
278
|
+
return (currentDirectory, modulePath, context = {})=>{
|
|
279
|
+
if (Array.isArray(modulePath)) throw new Error('Array module path is not supported in hot cases');
|
|
280
|
+
const file = context.file || this.getFile(modulePath, currentDirectory);
|
|
281
|
+
this.log(`json: ${modulePath} -> ${file?.path}`);
|
|
282
|
+
if (!file) return this.requirers.get('miss')(currentDirectory, modulePath);
|
|
283
|
+
return JSON.parse(external_node_fs_default().readFileSync(external_node_path_default().join(this._options.dist, modulePath), 'utf-8'));
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
createCjsRequirer() {
|
|
287
|
+
return (currentDirectory, modulePath, context = {})=>{
|
|
288
|
+
if ('@rspack/test-tools' === modulePath) return __webpack_require__("@rspack/test-tools");
|
|
289
|
+
const file = context.file || this.getFile(modulePath, currentDirectory);
|
|
290
|
+
this.log(`cjs: ${modulePath} -> ${file?.path}`);
|
|
291
|
+
if (!file) return this.requirers.get('miss')(currentDirectory, modulePath);
|
|
292
|
+
if (file.path in this.requireCache) {
|
|
293
|
+
this.log(`cjs cache hit: ${file.path}`);
|
|
294
|
+
return this.requireCache[file.path].exports;
|
|
357
295
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
let done;
|
|
362
|
-
const task = new Promise((resolve) => (done = resolve));
|
|
363
|
-
currentModuleScope.WAITING.push(task);
|
|
364
|
-
return () => {
|
|
365
|
-
next();
|
|
366
|
-
done();
|
|
367
|
-
};
|
|
296
|
+
const m = {
|
|
297
|
+
exports: {},
|
|
298
|
+
webpackTestSuiteModule: true
|
|
368
299
|
};
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
300
|
+
this.requireCache[file.path] = m;
|
|
301
|
+
if (!this._options.runInNewContext) file.content = `Object.assign(global, _globalAssign);${file.content}`;
|
|
302
|
+
const currentModuleScope = this.createModuleScope(this.getRequire(), m, file);
|
|
303
|
+
if (this._options.testConfig.moduleScope) this._options.testConfig.moduleScope(currentModuleScope, this._options.stats, this._options.compilerOptions);
|
|
304
|
+
if (file.content.includes('__STATS__') && this._options.stats) currentModuleScope.__STATS__ = this._options.stats();
|
|
305
|
+
if (file.content.includes('__STATS_I__')) {
|
|
306
|
+
const statsIndex = this._options.stats?.()?.__index__;
|
|
307
|
+
if ('number' == typeof statsIndex) currentModuleScope.__STATS_I__ = statsIndex;
|
|
308
|
+
}
|
|
309
|
+
if (file.content.includes('webpack/runtime/startup_chunk_dependencies')) {
|
|
310
|
+
currentModuleScope.__AFTER_CHUNK_LOADED__ = (next)=>{
|
|
311
|
+
let done;
|
|
312
|
+
const task = new Promise((resolve)=>done = resolve);
|
|
313
|
+
currentModuleScope.WAITING.push(task);
|
|
314
|
+
return ()=>{
|
|
315
|
+
next();
|
|
316
|
+
done();
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
file.content = file.content.replace('var next = __webpack_require__.x', 'var next = __AFTER_CHUNK_LOADED__(__webpack_require__.x)');
|
|
320
|
+
}
|
|
321
|
+
const args = Object.keys(currentModuleScope);
|
|
322
|
+
const argValues = args.map((arg)=>currentModuleScope[arg]);
|
|
323
|
+
const code = `(function(${args.join(', ')}) {
|
|
374
324
|
${file.content}
|
|
375
325
|
})`;
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
? node_vm_1.default.runInNewContext(code, this.globalContext, {
|
|
326
|
+
this.preExecute(code, file);
|
|
327
|
+
this.log(`run mode: ${this._options.runInNewContext ? 'new context' : 'this context'}`);
|
|
328
|
+
try {
|
|
329
|
+
const fn = this._options.runInNewContext ? external_node_vm_default().runInNewContext(code, this.globalContext, {
|
|
381
330
|
filename: file.path,
|
|
382
|
-
lineOffset: -1
|
|
383
|
-
})
|
|
384
|
-
: node_vm_1.default.runInThisContext(code, {
|
|
331
|
+
lineOffset: -1
|
|
332
|
+
}) : external_node_vm_default().runInThisContext(code, {
|
|
385
333
|
filename: file.path,
|
|
386
|
-
lineOffset: -1
|
|
334
|
+
lineOffset: -1
|
|
387
335
|
});
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
catch (e) {
|
|
393
|
-
this._options.errors?.push(e);
|
|
394
|
-
throw e;
|
|
395
|
-
}
|
|
396
|
-
this.postExecute(m, file);
|
|
397
|
-
this.log(`end cjs: ${modulePath}`);
|
|
398
|
-
return m.exports;
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
createEsmRequirer() {
|
|
402
|
-
const esmContext = node_vm_1.default.createContext(this.baseModuleScope, {
|
|
403
|
-
name: 'context for esm',
|
|
404
|
-
});
|
|
405
|
-
const esmCache = new Map();
|
|
406
|
-
const esmIdentifier = this._options.name;
|
|
407
|
-
return (currentDirectory, modulePath, context = {}) => {
|
|
408
|
-
if (!node_vm_1.SourceTextModule) {
|
|
409
|
-
throw new Error("Running this test requires '--experimental-vm-modules'.\nRun with 'node --experimental-vm-modules node_modules/@rstest/core/bin/rstest'.");
|
|
410
|
-
}
|
|
411
|
-
const _require = this.getRequire();
|
|
412
|
-
const file = context.file || this.getFile(modulePath, currentDirectory);
|
|
413
|
-
this.log(`esm: ${modulePath} -> ${file?.path}`);
|
|
414
|
-
if (!file) {
|
|
415
|
-
return this.requirers.get('miss')(currentDirectory, modulePath);
|
|
416
|
-
}
|
|
417
|
-
if (file.content.includes('__STATS__')) {
|
|
418
|
-
esmContext.__STATS__ = this._options.stats?.();
|
|
419
|
-
}
|
|
420
|
-
if (file.content.includes('__STATS_I__')) {
|
|
421
|
-
const statsIndex = this._options.stats?.()?.__index__;
|
|
422
|
-
if (typeof statsIndex === 'number') {
|
|
423
|
-
esmContext.__STATS_I__ = statsIndex;
|
|
336
|
+
fn.call(this._options.testConfig.nonEsmThis ? this._options.testConfig.nonEsmThis(modulePath) : m.exports, ...argValues);
|
|
337
|
+
} catch (e) {
|
|
338
|
+
this._options.errors?.push(e);
|
|
339
|
+
throw e;
|
|
424
340
|
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
esmCache.set(file.path, esm);
|
|
447
|
-
}
|
|
448
|
-
if (context.esmMode === type_1.EEsmMode.Unlinked)
|
|
449
|
-
return esm;
|
|
450
|
-
return (async () => {
|
|
451
|
-
if (esm.status === 'unlinked') {
|
|
452
|
-
await esm.link(async (specifier, referencingModule) => {
|
|
453
|
-
return await (0, asModule_1.default)(await _require(node_path_1.default.dirname(referencingModule.identifier
|
|
454
|
-
? referencingModule.identifier.slice(esmIdentifier.length + 1)
|
|
455
|
-
: (0, node_url_1.fileURLToPath)(referencingModule.url)), specifier, {
|
|
456
|
-
esmMode: type_1.EEsmMode.Unlinked,
|
|
457
|
-
}), referencingModule.context, true);
|
|
458
|
-
});
|
|
341
|
+
this.postExecute(m, file);
|
|
342
|
+
this.log(`end cjs: ${modulePath}`);
|
|
343
|
+
return m.exports;
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
createEsmRequirer() {
|
|
347
|
+
const esmContext = external_node_vm_default().createContext(this.baseModuleScope, {
|
|
348
|
+
name: 'context for esm'
|
|
349
|
+
});
|
|
350
|
+
const esmCache = new Map();
|
|
351
|
+
const esmIdentifier = this._options.name;
|
|
352
|
+
return (currentDirectory, modulePath, context = {})=>{
|
|
353
|
+
if (!external_node_vm_namespaceObject.SourceTextModule) throw new Error("Running this test requires '--experimental-vm-modules'.\nRun with 'node --experimental-vm-modules node_modules/@rstest/core/bin/rstest'.");
|
|
354
|
+
const _require = this.getRequire();
|
|
355
|
+
const file = context.file || this.getFile(modulePath, currentDirectory);
|
|
356
|
+
this.log(`esm: ${modulePath} -> ${file?.path}`);
|
|
357
|
+
if (!file) return this.requirers.get('miss')(currentDirectory, modulePath);
|
|
358
|
+
if (file.content.includes('__STATS__')) esmContext.__STATS__ = this._options.stats?.();
|
|
359
|
+
if (file.content.includes('__STATS_I__')) {
|
|
360
|
+
const statsIndex = this._options.stats?.()?.__index__;
|
|
361
|
+
if ('number' == typeof statsIndex) esmContext.__STATS_I__ = statsIndex;
|
|
459
362
|
}
|
|
460
|
-
|
|
461
|
-
if (
|
|
462
|
-
|
|
363
|
+
let esm = esmCache.get(file.path);
|
|
364
|
+
if (!esm) {
|
|
365
|
+
esm = new external_node_vm_namespaceObject.SourceTextModule(file.content, {
|
|
366
|
+
identifier: `${esmIdentifier}-${file.path}`,
|
|
367
|
+
url: `${(0, external_node_url_namespaceObject.pathToFileURL)(file.path).href}?${esmIdentifier}`,
|
|
368
|
+
context: esmContext,
|
|
369
|
+
initializeImportMeta: (meta, _)=>{
|
|
370
|
+
meta.url = (0, external_node_url_namespaceObject.pathToFileURL)(file.path).href;
|
|
371
|
+
meta.dirname = external_node_path_default().dirname(file.path);
|
|
372
|
+
meta.filename = file.path;
|
|
373
|
+
},
|
|
374
|
+
importModuleDynamically: async (specifier, module)=>{
|
|
375
|
+
this.log(`import: ${specifier} from ${file?.path}`);
|
|
376
|
+
const result = await _require(external_node_path_default().dirname(file.path), specifier, {
|
|
377
|
+
esmMode: external_type_js_namespaceObject.EEsmMode.Evaluated
|
|
378
|
+
});
|
|
379
|
+
return (0, asModule_js_namespaceObject.asModule)(result, module.context);
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
esmCache.set(file.path, esm);
|
|
463
383
|
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
384
|
+
if (context.esmMode === external_type_js_namespaceObject.EEsmMode.Unlinked) return esm;
|
|
385
|
+
return (async ()=>{
|
|
386
|
+
if ('unlinked' === esm.status) await esm.link(async (specifier, referencingModule)=>(0, asModule_js_namespaceObject.asModule)(await _require(external_node_path_default().dirname(referencingModule.identifier ? referencingModule.identifier.slice(esmIdentifier.length + 1) : (0, external_node_url_namespaceObject.fileURLToPath)(referencingModule.url)), specifier, {
|
|
387
|
+
esmMode: external_type_js_namespaceObject.EEsmMode.Unlinked
|
|
388
|
+
}), referencingModule.context, true));
|
|
389
|
+
await esm.evaluate();
|
|
390
|
+
if (context.esmMode === external_type_js_namespaceObject.EEsmMode.Evaluated) return esm;
|
|
391
|
+
const ns = esm.namespace;
|
|
392
|
+
this.log(`end esm: ${modulePath}`);
|
|
393
|
+
return ns.default && ns.default instanceof Promise ? ns.default : ns;
|
|
394
|
+
})();
|
|
395
|
+
};
|
|
396
|
+
}
|
|
469
397
|
}
|
|
470
|
-
}
|
|
471
|
-
exports.NodeRunner = NodeRunner;
|
|
398
|
+
})();
|
|
399
|
+
exports.NodeRunner = __webpack_exports__.NodeRunner;
|
|
400
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
401
|
+
"NodeRunner"
|
|
402
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
403
|
+
Object.defineProperty(exports, '__esModule', {
|
|
404
|
+
value: true
|
|
405
|
+
});
|