@stencil/vitest 1.16.0 → 1.16.1

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 Stencil components.
118
- // Adjust according to your build output of choice *
119
- await import('./dist/test-components/test-components.esm.js');
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
- // * Bear in mind, you may need `buildDist: true` (in your stencil.config)
123
- // or `--prod` to use an output other than the browser lazy-loader
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.esm.js');
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.esm.js');
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;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD"}
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, '><').trim();
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.0",
7
+ "version": "1.16.1",
8
8
  "description": "First-class testing utilities for Stencil design systems with Vitest",
9
9
  "license": "MIT",
10
10
  "type": "module",
@@ -111,7 +111,7 @@
111
111
  "dependencies": {
112
112
  "jiti": "^2.6.1",
113
113
  "local-pkg": "^1.1.2",
114
- "vitest-environment-stencil": "1.16.0"
114
+ "vitest-environment-stencil": "1.16.1"
115
115
  },
116
116
  "devDependencies": {
117
117
  "@eslint/js": "^9.39.2",