@stencil/vitest 1.11.6 → 1.12.0

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.
@@ -19,6 +19,13 @@ interface RenderOptions {
19
19
  * Spy configuration for this render call. Spies on methods, props, and lifecycle hooks.
20
20
  */
21
21
  spyOn?: SpyConfig;
22
+ /**
23
+ * The CustomElementRegistry in which the component is defined.
24
+ * Defaults to the global `customElements`. Pass a scoped registry when
25
+ * testing Scoped Custom Element Registry scenarios so that
26
+ * `whenDefined()` resolves against the correct registry.
27
+ */
28
+ registry?: CustomElementRegistry;
22
29
  }
23
30
  /**
24
31
  * Poll until element has dimensions (is rendered/visible in real browser).
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/testing/render.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAY,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAExF,UAAU,aAAa;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AA+FD;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,iBAAiB,EAAE,OAAO,GAAG,MAAM,EAAE,OAAO,SAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAyCtG;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,SAAO,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAY5F;AAED;;GAEG;AACH,wBAAsB,MAAM,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,CAAC,GAAG,GAAG,EACvE,QAAQ,EAAE,GAAG,GAAG,MAAM,EACtB,OAAO,GAAE,aAGR,GACA,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAyL7B"}
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/testing/render.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAY,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAExF,UAAU,aAAa;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC;AA+FD;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,iBAAiB,EAAE,OAAO,GAAG,MAAM,EAAE,OAAO,SAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAyCtG;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,SAAO,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAY5F;AAED;;GAEG;AACH,wBAAsB,MAAM,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,CAAC,GAAG,GAAG,EACvE,QAAQ,EAAE,GAAG,GAAG,MAAM,EACtB,OAAO,GAAE,aAGR,GACA,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAyL7B"}
@@ -176,7 +176,7 @@ export async function render(template, options = {
176
176
  }
177
177
  else {
178
178
  // Use Stencil's render which handles VNodes properly in the browser
179
- await stencilRender(template, container);
179
+ stencilRender(template, container);
180
180
  }
181
181
  // Get the rendered element
182
182
  const element = container.firstElementChild;
@@ -220,7 +220,7 @@ export async function render(template, options = {
220
220
  // Wait for custom element to be defined
221
221
  const tagName = element.tagName.toLowerCase();
222
222
  if (tagName.includes('-')) {
223
- await customElements.whenDefined(tagName);
223
+ await (options.registry ?? customElements).whenDefined(tagName);
224
224
  }
225
225
  // Wait for component to be ready
226
226
  if (typeof element.componentOnReady === 'function') {
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.11.6",
7
+ "version": "1.12.0",
8
8
  "description": "First-class testing utilities for Stencil design systems with Vitest",
9
9
  "license": "MIT",
10
10
  "type": "module",
@@ -104,7 +104,7 @@
104
104
  "dependencies": {
105
105
  "jiti": "^2.6.1",
106
106
  "local-pkg": "^1.1.2",
107
- "vitest-environment-stencil": "1.11.6"
107
+ "vitest-environment-stencil": "1.12.0"
108
108
  },
109
109
  "devDependencies": {
110
110
  "@eslint/js": "^9.39.2",