@rspack-canary/test-tools 1.7.0-canary-e20de023-20251223174329 → 1.7.0-canary-4941195f-20251224083309
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.
|
@@ -60,12 +60,9 @@ ${tooMuch.map(item => `${explain(item)}`).join("\n\n")}`);
|
|
|
60
60
|
return diff.join("\n\n");
|
|
61
61
|
};
|
|
62
62
|
module.exports = async function checkArrayExpectation(testDirectory, object, kind, filename, upperCaseKind, options, done) {
|
|
63
|
-
done =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
: error => {
|
|
67
|
-
throw error;
|
|
68
|
-
};
|
|
63
|
+
done = typeof done === "function" ? done : error => {
|
|
64
|
+
throw error;
|
|
65
|
+
};
|
|
69
66
|
let array = object[`${kind}s`];
|
|
70
67
|
if (Array.isArray(array) && kind === "warning") {
|
|
71
68
|
array = array.filter(item => !/from Terser/.test(item));
|
|
@@ -124,14 +121,14 @@ module.exports = async function checkArrayExpectation(testDirectory, object, kin
|
|
|
124
121
|
for (let j = 0; j < expected.length; j++) {
|
|
125
122
|
if (!usedExpected[j]) {
|
|
126
123
|
unused.push(Array.isArray(expected[j])
|
|
127
|
-
? expected[j].map(explain).join(
|
|
124
|
+
? expected[j].map(explain).join(' | ')
|
|
128
125
|
: explain(expected[j]));
|
|
129
126
|
}
|
|
130
127
|
}
|
|
131
128
|
if (unused.length > 0) {
|
|
132
129
|
done(new Error(`The following expected ${kind}s were not matched:\n${unused
|
|
133
130
|
.map(u => ` ${u}`)
|
|
134
|
-
.join(
|
|
131
|
+
.join('\n')}`));
|
|
135
132
|
return true;
|
|
136
133
|
}
|
|
137
134
|
}
|
|
@@ -107,7 +107,7 @@ if (${options.type === "module"}) {
|
|
|
107
107
|
set onmessage(value) {
|
|
108
108
|
if (this._onmessage)
|
|
109
109
|
this.worker.off("message", this._onmessage);
|
|
110
|
-
this.worker.on("message", (this._onmessage = data => {
|
|
110
|
+
this.worker.on("message", (this._onmessage = (data) => {
|
|
111
111
|
value({
|
|
112
112
|
data
|
|
113
113
|
});
|
|
@@ -4,18 +4,24 @@
|
|
|
4
4
|
Author Tobias Koppers @sokra
|
|
5
5
|
*/
|
|
6
6
|
"use strict";
|
|
7
|
+
const util = require("util");
|
|
7
8
|
let interception = undefined;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
const originalDeprecate = util.deprecate;
|
|
10
|
+
util.deprecate = (fn, message, code) => {
|
|
11
|
+
const original = originalDeprecate(fn, message, code);
|
|
12
|
+
return function (...args) {
|
|
13
|
+
if (interception) {
|
|
14
|
+
interception.set(`${code}: ${message}`, {
|
|
15
|
+
code,
|
|
16
|
+
message,
|
|
17
|
+
stack: new Error(message).stack
|
|
18
|
+
});
|
|
19
|
+
return fn.apply(this, args);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return original.apply(this, args);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
19
25
|
};
|
|
20
26
|
exports.start = handler => {
|
|
21
27
|
interception = new Map();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack-canary/test-tools",
|
|
3
|
-
"version": "1.7.0-canary-
|
|
3
|
+
"version": "1.7.0-canary-4941195f-20251224083309",
|
|
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.7.0-canary-
|
|
68
|
+
"@rspack/core": "npm:@rspack-canary/core@1.7.0-canary-4941195f-20251224083309"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@rspack/core": ">=1.0.0"
|