@rspack/test-tools 1.3.7 → 1.3.9

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.
@@ -49,7 +49,7 @@ function getWatchCreator(options) {
49
49
  description: (name, index) => {
50
50
  return index === 0
51
51
  ? `${name} should compile`
52
- : `should compile the next step ${index}`;
52
+ : `should compile step ${index}`;
53
53
  },
54
54
  describe: false,
55
55
  steps: ({ name, src, temp }) => {
@@ -72,7 +72,7 @@ function getWatchCreator(options) {
72
72
  defaultOptions(index, context) {
73
73
  return {
74
74
  experiments: {
75
- incremental: true
75
+ incremental: "advance"
76
76
  },
77
77
  ignoreWarnings: options.ignoreNotFriendlyForIncrementalWarnings
78
78
  ? [/is not friendly for incremental/]
@@ -16,7 +16,7 @@ const creator = new creator_1.BasicCaseCreator({
16
16
  description: (name, index) => {
17
17
  return index === 0
18
18
  ? `${name} should compile`
19
- : `should compile the next step ${index}`;
19
+ : `should compile step ${index}`;
20
20
  },
21
21
  describe: false,
22
22
  steps: ({ name, src, temp }) => {
@@ -67,6 +67,9 @@ class BasicProcessor {
67
67
  return;
68
68
  }
69
69
  for (const bundle of bundles) {
70
+ if (!bundle) {
71
+ continue;
72
+ }
70
73
  const runnerFactory = context.getRunnerFactory(this._options.name);
71
74
  if (!runnerFactory) {
72
75
  throw new Error(`Test case ${this._options.name} is not runable`);
@@ -29,7 +29,7 @@ class HotNewIncrementalProcessor extends hot_1.HotProcessor {
29
29
  if (this._hotOptions.compilerType === type_1.ECompilerType.Rspack) {
30
30
  const rspackOptions = options;
31
31
  rspackOptions.experiments ??= {};
32
- rspackOptions.experiments.incremental ??= true;
32
+ rspackOptions.experiments.incremental ??= "advance";
33
33
  }
34
34
  else {
35
35
  throw new Error("HotNewIncrementalProcessor should only used for Rspack.");
@@ -79,34 +79,31 @@ class BasicCaseCreator {
79
79
  });
80
80
  const ender = this.registerConcurrentTask(name, starter);
81
81
  const env = this.createConcurrentEnv();
82
- let bailout = false;
83
82
  for (let index = 0; index < tester.total; index++) {
84
83
  let stepSignalResolve = null;
85
- let stepSignalReject = null;
86
84
  const stepSignal = new Promise((resolve, reject) => {
87
85
  stepSignalResolve = resolve;
88
- stepSignalReject = reject;
86
+ }).catch(e => {
87
+ // prevent unhandled rejection
89
88
  });
90
89
  const description = typeof this._options.description === "function"
91
90
  ? this._options.description(name, index)
92
91
  : index
93
92
  ? `step [${index}] should pass`
94
93
  : "should pass";
95
- it(description, async () => {
96
- await stepSignal;
94
+ it(description, cb => {
95
+ stepSignal.then((e) => {
96
+ cb(e);
97
+ });
97
98
  }, this._options.timeout || 180000);
98
99
  chain = chain.then(async () => {
99
100
  try {
100
- if (bailout) {
101
- throw `Case "${name}" step ${index + 1} bailout because ${tester.step + 1} failed`;
102
- }
103
101
  env.clear();
104
102
  await tester.compile();
105
103
  await tester.check(env);
106
104
  await env.run();
107
105
  const context = tester.getContext();
108
106
  if (!tester.next() && context.hasError()) {
109
- bailout = true;
110
107
  const errors = context
111
108
  .getError()
112
109
  .map(i => `${i.stack}`.split("\n").join("\t\n"))
@@ -116,11 +113,21 @@ class BasicCaseCreator {
116
113
  stepSignalResolve();
117
114
  }
118
115
  catch (e) {
119
- stepSignalReject(e);
116
+ stepSignalResolve(e);
117
+ return Promise.reject();
120
118
  }
119
+ }, e => {
120
+ // bailout
121
+ stepSignalResolve();
122
+ return Promise.reject();
121
123
  });
122
124
  }
123
- chain.finally(() => {
125
+ chain
126
+ .catch(e => {
127
+ // bailout error
128
+ // prevent unhandled rejection
129
+ })
130
+ .finally(() => {
124
131
  ender();
125
132
  });
126
133
  afterAll(async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/test-tools",
3
- "version": "1.3.7",
3
+ "version": "1.3.9",
4
4
  "license": "MIT",
5
5
  "description": "Test tools for rspack",
6
6
  "main": "dist/index.js",
@@ -31,43 +31,42 @@
31
31
  "directory": "packages/rspack-test-tools"
32
32
  },
33
33
  "dependencies": {
34
- "@babel/generator": "7.27.0",
35
- "@babel/parser": "7.27.0",
36
- "@babel/traverse": "7.27.0",
37
- "@babel/types": "7.27.0",
34
+ "@babel/generator": "7.27.1",
35
+ "@babel/parser": "7.27.2",
36
+ "@babel/traverse": "7.27.1",
37
+ "@babel/types": "7.27.1",
38
38
  "cross-env": "^7.0.3",
39
39
  "csv-to-markdown-table": "^1.5.0",
40
40
  "deepmerge": "^4.3.1",
41
41
  "filenamify": "4.3.0",
42
42
  "fs-extra": "^11.3.0",
43
- "glob": "^11.0.1",
43
+ "glob": "^11.0.2",
44
44
  "graceful-fs": "^4.2.11",
45
45
  "iconv-lite": "^0.6.3",
46
46
  "jest-diff": "^29.7.0",
47
47
  "jest-snapshot": "29.7.0",
48
48
  "jsdom": "^26.1.0",
49
- "loader-utils": "^2.0.4",
50
- "memfs": "4.17.0",
51
- "path-serializer": "0.3.4",
49
+ "memfs": "4.17.1",
50
+ "path-serializer": "0.4.0",
52
51
  "pretty-format": "29.7.0",
53
52
  "rimraf": "^5.0.10",
54
53
  "source-map": "^0.7.4",
55
54
  "terser-webpack-plugin": "^5.3.14",
56
- "webpack": "5.99.6",
57
- "webpack-merge": "5.10.0",
55
+ "webpack": "5.99.8",
56
+ "webpack-merge": "6.0.1",
58
57
  "webpack-sources": "3.2.3"
59
58
  },
60
59
  "devDependencies": {
61
60
  "@rspack/plugin-preact-refresh": "1.1.2",
62
- "@rspack/plugin-react-refresh": "^1.2.1",
61
+ "@rspack/plugin-react-refresh": "^1.4.1",
63
62
  "@swc/helpers": "0.5.17",
64
- "@swc/plugin-remove-console": "^7.0.3",
63
+ "@swc/plugin-remove-console": "^7.0.4",
65
64
  "@types/babel__generator": "7.27.0",
66
65
  "@types/babel__traverse": "7.20.7",
67
66
  "@types/fs-extra": "11.0.4",
68
67
  "@types/jsdom": "^21.1.7",
69
- "@types/react": "^19.1.2",
70
- "@types/react-dom": "^19.1.2",
68
+ "@types/react": "^19.1.3",
69
+ "@types/react-dom": "^19.1.3",
71
70
  "@types/webpack": "5.28.5",
72
71
  "@types/webpack-sources": "3.2.3",
73
72
  "@webdiscus/pug-loader": "^2.11.1",
@@ -75,7 +74,7 @@
75
74
  "babel-loader": "^10.0.0",
76
75
  "babel-plugin-import": "^1.13.8",
77
76
  "chalk": "^4.1.2",
78
- "core-js": "3.41.0",
77
+ "core-js": "3.42.0",
79
78
  "css-loader": "^7.1.2",
80
79
  "file-loader": "^6.2.0",
81
80
  "graceful-fs": "^4.2.11",
@@ -94,12 +93,12 @@
94
93
  "source-map-loader": "^5.0.0",
95
94
  "style-loader": "^4.0.0",
96
95
  "terser": "5.39.0",
97
- "typescript": "^5.7.3",
96
+ "typescript": "^5.8.3",
98
97
  "wast-loader": "^1.14.1",
99
98
  "worker-rspack-loader": "^3.1.2",
100
- "@rspack/test-tools": "1.3.7",
101
- "@rspack/core": "1.3.7",
102
- "@rspack/cli": "1.3.7"
99
+ "@rspack/core": "1.3.9",
100
+ "@rspack/test-tools": "1.3.9",
101
+ "@rspack/cli": "1.3.9"
103
102
  },
104
103
  "peerDependencies": {
105
104
  "@rspack/core": ">=1.0.0"