@stencil/vitest 1.1.11 → 1.1.13
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/README.md
CHANGED
|
@@ -101,7 +101,7 @@ describe('my-button', () => {
|
|
|
101
101
|
const { root, waitForChanges } = await render(<my-button label="Click me" />);
|
|
102
102
|
root.click();
|
|
103
103
|
await waitForChanges();
|
|
104
|
-
expect(root).toEqualHtml(`
|
|
104
|
+
await expect(root).toEqualHtml(`
|
|
105
105
|
<my-button class="hydrated">
|
|
106
106
|
<mock:shadow-root>
|
|
107
107
|
<button class="button button--secondary button--small" type="button">
|
|
@@ -171,8 +171,8 @@ expect(element).toEqualText('Exact text match');
|
|
|
171
171
|
|
|
172
172
|
// Shadow DOM
|
|
173
173
|
expect(element).toHaveShadowRoot();
|
|
174
|
-
expect(element).toEqualHtml('<div>Expected HTML</div>');
|
|
175
|
-
expect(element).toEqualLightHtml('<div>Light DOM only</div>');
|
|
174
|
+
await expect(element).toEqualHtml('<div>Expected HTML</div>');
|
|
175
|
+
await expect(element).toEqualLightHtml('<div>Light DOM only</div>');
|
|
176
176
|
```
|
|
177
177
|
|
|
178
178
|
### Event Testing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stencil.d.ts","sourceRoot":"","sources":["../../src/environments/stencil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAOvD,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,cAAc,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC;CACrD;AAQD;;;;;;;;;;;;;;;;GAgBG;wBACa,WAAW;AAA3B,
|
|
1
|
+
{"version":3,"file":"stencil.d.ts","sourceRoot":"","sources":["../../src/environments/stencil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAOvD,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,cAAc,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC;CACrD;AAQD;;;;;;;;;;;;;;;;GAgBG;wBACa,WAAW;AAA3B,wBAmEE"}
|
|
@@ -56,6 +56,18 @@ export default {
|
|
|
56
56
|
const { keys, originals } = populateGlobal(global, win, {
|
|
57
57
|
bindFunctions: true,
|
|
58
58
|
});
|
|
59
|
+
const nativeEventConstructors = ['Event', 'CustomEvent', 'MessageEvent', 'ErrorEvent'];
|
|
60
|
+
nativeEventConstructors.forEach((name) => {
|
|
61
|
+
if (originals.has(name)) {
|
|
62
|
+
global[name] = originals.get(name);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
// Remove undefined properties that shadow native globals
|
|
66
|
+
keys.forEach((key) => {
|
|
67
|
+
if (global[key] === undefined && originals.has(key)) {
|
|
68
|
+
global[key] = originals.get(key);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
59
71
|
return {
|
|
60
72
|
teardown(global) {
|
|
61
73
|
// Teardown the environment first (e.g., window.close())
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "https://github.com/stenciljs/vitest"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.1.
|
|
7
|
+
"version": "1.1.13",
|
|
8
8
|
"description": "First-class testing utilities for Stencil design systems with Vitest",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"type": "module",
|
|
@@ -72,6 +72,9 @@
|
|
|
72
72
|
"@wdio/globals": {
|
|
73
73
|
"optional": true
|
|
74
74
|
},
|
|
75
|
+
"@stencil/mock-doc": {
|
|
76
|
+
"optional": true
|
|
77
|
+
},
|
|
75
78
|
"jsdom": {
|
|
76
79
|
"optional": true
|
|
77
80
|
},
|
|
@@ -94,7 +97,7 @@
|
|
|
94
97
|
"dependencies": {
|
|
95
98
|
"jiti": "^2.6.1",
|
|
96
99
|
"local-pkg": "^1.1.2",
|
|
97
|
-
"vitest-environment-stencil": "1.1.
|
|
100
|
+
"vitest-environment-stencil": "1.1.13"
|
|
98
101
|
},
|
|
99
102
|
"devDependencies": {
|
|
100
103
|
"@eslint/js": "^9.39.2",
|