@rspack-canary/test-tools 1.6.4-canary-dceb4c75-20251116173406 → 1.6.5-canary-aa49744b-20251119174225
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/helper/directory.js
CHANGED
|
@@ -21,6 +21,7 @@ function describeByWalk(testFile, createCase, options = {}) {
|
|
|
21
21
|
.replace(/\.(diff|hot)?test\.(j|t)s/, "");
|
|
22
22
|
const testId = testBasename.charAt(0).toLowerCase() + testBasename.slice(1);
|
|
23
23
|
const sourceBase = options.source || node_path_1.default.join(node_path_1.default.dirname(testFile), `${testId}Cases`);
|
|
24
|
+
const testSourceId = node_path_1.default.basename(sourceBase);
|
|
24
25
|
const distBase = options.dist || node_path_1.default.join(node_path_1.default.dirname(testFile), "js", testId);
|
|
25
26
|
const level = options.level || 2;
|
|
26
27
|
const type = options.type || "directory";
|
|
@@ -54,7 +55,10 @@ function describeByWalk(testFile, createCase, options = {}) {
|
|
|
54
55
|
describeDirectory(caseName, currentLevel - 1);
|
|
55
56
|
}
|
|
56
57
|
else {
|
|
57
|
-
const name = (0, _1.escapeSep)(node_path_1.default
|
|
58
|
+
const name = (0, _1.escapeSep)(node_path_1.default
|
|
59
|
+
.join(`${testId}Cases-${testSourceId}`, caseName)
|
|
60
|
+
.split(".")
|
|
61
|
+
.shift());
|
|
58
62
|
describeFn(name, () => {
|
|
59
63
|
const source = node_path_1.default.join(sourceBase, caseName);
|
|
60
64
|
let dist = "";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function disableIconvLiteWarning(): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.disableIconvLiteWarning = disableIconvLiteWarning;
|
|
4
|
+
function disableIconvLiteWarning() {
|
|
5
|
+
for (const [path, mod] of Object.entries(require.cache)) {
|
|
6
|
+
if (path.includes("iconv-lite") &&
|
|
7
|
+
typeof mod?.exports === "object" &&
|
|
8
|
+
typeof mod.exports.decode === "function") {
|
|
9
|
+
mod.exports.skipDecodeWarning = true;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -22,3 +22,4 @@ __exportStar(require("./test/context"), exports);
|
|
|
22
22
|
__exportStar(require("./test/creator"), exports);
|
|
23
23
|
__exportStar(require("./test/tester"), exports);
|
|
24
24
|
__exportStar(require("./type"), exports);
|
|
25
|
+
require("./helper/disable-iconv-lite-warning").disableIconvLiteWarning();
|
|
@@ -89,6 +89,9 @@ class NodeRunner {
|
|
|
89
89
|
node_path_1.default.isAbsolute(file)
|
|
90
90
|
? file
|
|
91
91
|
: `./${file}`);
|
|
92
|
+
if (this.globalContext.WAITING.length) {
|
|
93
|
+
return Promise.all(this.globalContext.WAITING).then(() => res);
|
|
94
|
+
}
|
|
92
95
|
if (typeof res === "object" && "then" in res) {
|
|
93
96
|
return res;
|
|
94
97
|
}
|
|
@@ -152,6 +155,7 @@ class NodeRunner {
|
|
|
152
155
|
console.clear();
|
|
153
156
|
}
|
|
154
157
|
},
|
|
158
|
+
WAITING: [],
|
|
155
159
|
setTimeout: ((cb, ms, ...args) => {
|
|
156
160
|
const timeout = setTimeout(cb, ms, ...args);
|
|
157
161
|
timeout.unref();
|
|
@@ -171,6 +175,7 @@ class NodeRunner {
|
|
|
171
175
|
});
|
|
172
176
|
return m;
|
|
173
177
|
},
|
|
178
|
+
WAITING: this.globalContext.WAITING,
|
|
174
179
|
process,
|
|
175
180
|
URL,
|
|
176
181
|
Blob,
|
|
@@ -347,6 +352,18 @@ class NodeRunner {
|
|
|
347
352
|
currentModuleScope.__STATS_I__ = statsIndex;
|
|
348
353
|
}
|
|
349
354
|
}
|
|
355
|
+
if (file.content.includes("webpack/runtime/startup_chunk_dependencies")) {
|
|
356
|
+
currentModuleScope.__AFTER_CHUNK_LOADED__ = (next) => {
|
|
357
|
+
let done;
|
|
358
|
+
const task = new Promise(resolve => (done = resolve));
|
|
359
|
+
currentModuleScope.WAITING.push(task);
|
|
360
|
+
return () => {
|
|
361
|
+
next();
|
|
362
|
+
done();
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
file.content = file.content.replace("var next = __webpack_require__.x", "var next = __AFTER_CHUNK_LOADED__(__webpack_require__.x)");
|
|
366
|
+
}
|
|
350
367
|
const args = Object.keys(currentModuleScope);
|
|
351
368
|
const argValues = args.map(arg => currentModuleScope[arg]);
|
|
352
369
|
const code = `(function(${args.join(", ")}) {
|
package/dist/test/creator.js
CHANGED
|
@@ -9,7 +9,9 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
9
9
|
const rimraf_1 = require("rimraf");
|
|
10
10
|
const createLazyTestEnv_1 = __importDefault(require("../helper/legacy/createLazyTestEnv"));
|
|
11
11
|
const tester_1 = require("./tester");
|
|
12
|
-
const DEFAULT_MAX_CONCURRENT = process.env.WASM
|
|
12
|
+
const DEFAULT_MAX_CONCURRENT = process.env.WASM
|
|
13
|
+
? 1
|
|
14
|
+
: Number(process.env.DEFAULT_MAX_CONCURRENT) || 5;
|
|
13
15
|
class BasicCaseCreator {
|
|
14
16
|
constructor(_options) {
|
|
15
17
|
this._options = _options;
|
|
@@ -102,7 +104,7 @@ class BasicCaseCreator {
|
|
|
102
104
|
if (e) {
|
|
103
105
|
throw e;
|
|
104
106
|
}
|
|
105
|
-
}, options.timeout
|
|
107
|
+
}, options.timeout);
|
|
106
108
|
chain = chain.then(async () => {
|
|
107
109
|
try {
|
|
108
110
|
env.clear();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack-canary/test-tools",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.5-canary-aa49744b-20251119174225",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Test tools for rspack",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@types/jsdom": "^21.1.7",
|
|
66
66
|
"typescript": "^5.9.3",
|
|
67
67
|
"wast-loader": "^1.14.1",
|
|
68
|
-
"@rspack/core": "npm:@rspack-canary/core@1.6.
|
|
68
|
+
"@rspack/core": "npm:@rspack-canary/core@1.6.5-canary-aa49744b-20251119174225"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@rspack/core": ">=1.0.0"
|