@stencil/vitest 1.16.0 → 1.16.2
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
|
@@ -114,13 +114,15 @@ export default defineVitestConfig({
|
|
|
114
114
|
```typescript
|
|
115
115
|
// vitest-setup.ts
|
|
116
116
|
|
|
117
|
-
// Load
|
|
118
|
-
//
|
|
119
|
-
|
|
117
|
+
// Load your components' lazy-loader build.
|
|
118
|
+
// Stencil v5: dist/loader-bundle/<namespace>/<namespace>.js
|
|
119
|
+
// Stencil v4: dist/<namespace>/<namespace>.esm.js
|
|
120
|
+
await import('./dist/loader-bundle/test-components/test-components.js');
|
|
120
121
|
|
|
121
122
|
export {};
|
|
122
|
-
//
|
|
123
|
-
//
|
|
123
|
+
// To test against a different output target, set `skipInDev: false` on it in your
|
|
124
|
+
// stencil.config (Stencil v4: `buildDist: true`), or run with `--prod`.
|
|
125
|
+
// Development builds skip those outputs otherwise.
|
|
124
126
|
```
|
|
125
127
|
|
|
126
128
|
### 4. Write Tests
|
|
@@ -231,11 +233,11 @@ Spy on component methods, props, and lifecycle hooks to verify behaviour without
|
|
|
231
233
|
>
|
|
232
234
|
> ```diff
|
|
233
235
|
> // vitest-setup.ts
|
|
234
|
-
> - await import('./dist/test-components/test-components.
|
|
236
|
+
> - await import('./dist/loader-bundle/test-components/test-components.js');
|
|
235
237
|
>
|
|
236
238
|
> + import { beforeAll } from 'vitest';
|
|
237
239
|
> + beforeAll(async () => {
|
|
238
|
-
> + await import('./dist/test-components/test-components.
|
|
240
|
+
> + await import('./dist/loader-bundle/test-components/test-components.js');
|
|
239
241
|
> + });
|
|
240
242
|
> ```
|
|
241
243
|
|
|
@@ -21,7 +21,8 @@ export declare function serializeHtml(input: HTMLElement | ShadowRoot | Document
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function prettifyHtml(html: string): string;
|
|
23
23
|
/**
|
|
24
|
-
* Normalize HTML for comparison by removing extra whitespace
|
|
24
|
+
* Normalize HTML for comparison by removing extra whitespace,
|
|
25
|
+
* including whitespace between a tag and its text content
|
|
25
26
|
*/
|
|
26
27
|
export declare function normalizeHtml(html: string): string;
|
|
27
28
|
//# sourceMappingURL=html-serializer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-serializer.d.ts","sourceRoot":"","sources":["../../src/testing/html-serializer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkCH,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,qCAAqC;IACrC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,gBAAgB,GAAG,MAAM,EAC3D,OAAO,GAAE,gBAAqB,GAC7B,MAAM,CAWR;AAiJD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAuDjD;AAED
|
|
1
|
+
{"version":3,"file":"html-serializer.d.ts","sourceRoot":"","sources":["../../src/testing/html-serializer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkCH,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,qCAAqC;IACrC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,gBAAgB,GAAG,MAAM,EAC3D,OAAO,GAAE,gBAAqB,GAC7B,MAAM,CAWR;AAiJD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAuDjD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
|
@@ -224,8 +224,9 @@ export function prettifyHtml(html) {
|
|
|
224
224
|
return lines.join('\n');
|
|
225
225
|
}
|
|
226
226
|
/**
|
|
227
|
-
* Normalize HTML for comparison by removing extra whitespace
|
|
227
|
+
* Normalize HTML for comparison by removing extra whitespace,
|
|
228
|
+
* including whitespace between a tag and its text content
|
|
228
229
|
*/
|
|
229
230
|
export function normalizeHtml(html) {
|
|
230
|
-
return html.replace(/\s+/g, ' ').replace(/>\s+</g, '
|
|
231
|
+
return html.replace(/\s+/g, ' ').replace(/>\s+/g, '>').replace(/\s+</g, '<').trim();
|
|
231
232
|
}
|
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.16.
|
|
7
|
+
"version": "1.16.2",
|
|
8
8
|
"description": "First-class testing utilities for Stencil design systems with Vitest",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"type": "module",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"access": "public"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"@stencil/core": "^4.0.0 ||
|
|
79
|
+
"@stencil/core": "^4.0.0 || ^5.0.0-alpha.0",
|
|
80
80
|
"vitest": "^5.0.0 || ^4.0.0 || ^3.0.0 || ^2.0.0"
|
|
81
81
|
},
|
|
82
82
|
"peerDependenciesMeta": {
|
|
@@ -111,15 +111,15 @@
|
|
|
111
111
|
"dependencies": {
|
|
112
112
|
"jiti": "^2.6.1",
|
|
113
113
|
"local-pkg": "^1.1.2",
|
|
114
|
-
"vitest-environment-stencil": "1.16.
|
|
114
|
+
"vitest-environment-stencil": "1.16.2"
|
|
115
115
|
},
|
|
116
116
|
"devDependencies": {
|
|
117
117
|
"@eslint/js": "^9.39.2",
|
|
118
118
|
"@semantic-release/changelog": "^6.0.3",
|
|
119
119
|
"@semantic-release/exec": "^6.0.3",
|
|
120
120
|
"@semantic-release/git": "^10.0.1",
|
|
121
|
-
"@stencil/cli": "^5.0.0
|
|
122
|
-
"@stencil/core": "^4.0.0 ||
|
|
121
|
+
"@stencil/cli": "^5.0.0-alpha.0",
|
|
122
|
+
"@stencil/core": "^4.0.0 || ^5.0.0-alpha.0",
|
|
123
123
|
"@types/node": "24.10.4",
|
|
124
124
|
"@typescript-eslint/eslint-plugin": "^8.50.0",
|
|
125
125
|
"@typescript-eslint/parser": "^8.50.0",
|