@rspack-canary/test-tools 1.6.4-canary-0853cbf5-20251117173648 → 1.6.5-canary-a8913069-20251120042030

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.
@@ -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(", ")}) {
@@ -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 ? 1 : 5;
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 || 300000);
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.4-canary-0853cbf5-20251117173648",
3
+ "version": "1.6.5-canary-a8913069-20251120042030",
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.4-canary-0853cbf5-20251117173648"
68
+ "@rspack/core": "npm:@rspack-canary/core@1.6.5-canary-a8913069-20251120042030"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "@rspack/core": ">=1.0.0"