@rspack/test-tools 1.0.9 → 1.0.11
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.
|
@@ -10,6 +10,7 @@ const RUNTIME_MODULE_NAME_MAPPING = {
|
|
|
10
10
|
"webpack/runtime/compat_get_default_export": "webpack/runtime/compat get default export",
|
|
11
11
|
"webpack/runtime/compat": "webpack/runtime/compat",
|
|
12
12
|
"webpack/runtime/create_fake_namespace_object": "webpack/runtime/create fake namespace object",
|
|
13
|
+
"webpack/runtime/create_script_url": "webpack/runtime/trusted types script url",
|
|
13
14
|
"webpack/runtime/create_script": "webpack/runtime/trusted types script",
|
|
14
15
|
"webpack/runtime/define_property_getters": "webpack/runtime/define property getters",
|
|
15
16
|
"webpack/runtime/ensure_chunk": "webpack/runtime/ensure chunk",
|
|
@@ -11,6 +11,7 @@ export default class FakeDocument {
|
|
|
11
11
|
_onElementAttached(element: any): void;
|
|
12
12
|
_onElementRemoved(element: any): void;
|
|
13
13
|
getElementsByTagName(name: any): FakeElement[];
|
|
14
|
+
querySelectorAll(name: any): FakeElement[];
|
|
14
15
|
getComputedStyle(element: any): {
|
|
15
16
|
getPropertyValue: (property: any) => any;
|
|
16
17
|
};
|
|
@@ -19,6 +20,7 @@ export class FakeElement {
|
|
|
19
20
|
constructor(document: any, type: any, basePath: any);
|
|
20
21
|
_document: any;
|
|
21
22
|
_type: any;
|
|
23
|
+
_basePath: any;
|
|
22
24
|
_children: any[];
|
|
23
25
|
_attributes: any;
|
|
24
26
|
_src: any;
|
|
@@ -26,6 +28,8 @@ export class FakeElement {
|
|
|
26
28
|
rel: any;
|
|
27
29
|
parentNode: any;
|
|
28
30
|
sheet: FakeSheet | undefined;
|
|
31
|
+
cloneNode(): FakeElement;
|
|
32
|
+
addEventListener(): void;
|
|
29
33
|
insertBefore(node: any, before: any): void;
|
|
30
34
|
appendChild(node: any): void;
|
|
31
35
|
removeChild(node: any): void;
|
|
@@ -41,6 +41,9 @@ class FakeDocument {
|
|
|
41
41
|
getElementsByTagName(name) {
|
|
42
42
|
return this._elementsByTagName.get(name) || [];
|
|
43
43
|
}
|
|
44
|
+
querySelectorAll(name) {
|
|
45
|
+
return this._elementsByTagName.get(name) || [];
|
|
46
|
+
}
|
|
44
47
|
getComputedStyle(element) {
|
|
45
48
|
const style = { getPropertyValue };
|
|
46
49
|
const links = this.getElementsByTagName("link");
|
|
@@ -59,6 +62,7 @@ class FakeElement {
|
|
|
59
62
|
constructor(document, type, basePath) {
|
|
60
63
|
this._document = document;
|
|
61
64
|
this._type = type;
|
|
65
|
+
this._basePath = basePath;
|
|
62
66
|
this._children = [];
|
|
63
67
|
this._attributes = Object.create(null);
|
|
64
68
|
this._src = undefined;
|
|
@@ -67,6 +71,10 @@ class FakeElement {
|
|
|
67
71
|
this.parentNode = undefined;
|
|
68
72
|
this.sheet = type === "link" ? new FakeSheet(this, basePath) : undefined;
|
|
69
73
|
}
|
|
74
|
+
cloneNode() {
|
|
75
|
+
return new FakeElement(this._document, this._type, this._basePath);
|
|
76
|
+
}
|
|
77
|
+
addEventListener() { }
|
|
70
78
|
insertBefore(node, before) {
|
|
71
79
|
this._document._onElementAttached(node);
|
|
72
80
|
node.parentNode = this;
|
package/dist/processor/error.js
CHANGED
|
@@ -27,9 +27,11 @@ function cleanError(err) {
|
|
|
27
27
|
return result;
|
|
28
28
|
}
|
|
29
29
|
function serialize(received) {
|
|
30
|
-
return (0, pretty_format_1.default)(received, prettyFormatOptions)
|
|
30
|
+
return ((0, pretty_format_1.default)(received, prettyFormatOptions)
|
|
31
31
|
.replace(CWD_PATTERN, "<cwd>")
|
|
32
|
-
|
|
32
|
+
// replace line numbers in error stacks
|
|
33
|
+
.replace(/:\d+:\d+/g, ":<line>:<col>")
|
|
34
|
+
.trim());
|
|
33
35
|
}
|
|
34
36
|
const prettyFormatOptions = {
|
|
35
37
|
escapeRegex: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/test-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Test tools for rspack",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
"terser": "5.27.2",
|
|
102
102
|
"typescript": "5.0.2",
|
|
103
103
|
"wast-loader": "^1.12.1",
|
|
104
|
-
"@rspack/cli": "1.0.
|
|
105
|
-
"@rspack/core": "1.0.
|
|
104
|
+
"@rspack/cli": "1.0.11",
|
|
105
|
+
"@rspack/core": "1.0.11"
|
|
106
106
|
},
|
|
107
107
|
"peerDependencies": {
|
|
108
108
|
"@rspack/core": ">=0.7.0"
|