@stencil/vitest 1.15.1 → 1.16.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.
package/README.md CHANGED
@@ -42,6 +42,8 @@ First-class testing utilities for Stencil components, powered by Vitest.
42
42
  npm i --save-dev @stencil/vitest vitest
43
43
  ```
44
44
 
45
+ Requires Node.js `^22.12.0 || ^24.0.0 || >=26.0.0`. Vitest 2, 3, 4, and 5 are supported; Vitest 5 also requires Vite `^6.4.0 || ^7.0.0 || ^8.0.0`. See the [Vitest migration guide](https://vitest.dev/guide/migration) when upgrading an existing project.
46
+
45
47
  For browser testing, also install:
46
48
 
47
49
  ```bash
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=environment.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.spec.d.ts","sourceRoot":"","sources":["../../src/__tests__/environment.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { expect, it } from 'vitest';
2
+ import environment from '../environments/stencil.js';
3
+ it.each(['mock-doc', 'jsdom', 'happy-dom'])('%s keeps the native Event constructor usable during setup and after teardown', async (domEnvironment) => {
4
+ const target = { Event };
5
+ const { teardown } = await environment.setup(target, { stencil: { domEnvironment } });
6
+ try {
7
+ expect(new target.Event('ready')).toBeInstanceOf(Event);
8
+ expect(target.document.createElement('div').tagName).toBe('DIV');
9
+ }
10
+ finally {
11
+ await teardown(target);
12
+ }
13
+ expect(target.Event).toBe(Event);
14
+ expect(target).not.toHaveProperty('document');
15
+ });
@@ -1,4 +1,5 @@
1
- import type { Environment } from 'vitest/environments';
1
+ import type { WorkerGlobalState } from 'vitest';
2
+ type Environment = WorkerGlobalState['environment'];
2
3
  export interface StencilEnvironmentOptions {
3
4
  /**
4
5
  * The DOM environment to use for testing
@@ -23,6 +24,6 @@ export interface StencilEnvironmentOptions {
23
24
  * })
24
25
  * ```
25
26
  */
26
- declare const _default: Environment;
27
- export default _default;
27
+ declare const environment: Environment;
28
+ export default environment;
28
29
  //# sourceMappingURL=stencil.d.ts.map
@@ -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;AAiBvD,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,cAAc,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC;CACrD;AAQD;;;;;;;;;;;;;;;;GAgBG;wBACa,WAAW;AAA3B,wBA6FE"}
1
+ {"version":3,"file":"stencil.d.ts","sourceRoot":"","sources":["../../src/environments/stencil.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAOhD,KAAK,WAAW,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAmCpD,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,cAAc,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC;CACrD;AAQD;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,WAAW,EAAE,WAsGlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,17 +1,40 @@
1
- // Dynamically import populateGlobal to support both vitest 4.1+ (vitest/runtime) and older versions (vitest/environments)
2
- async function getPopulateGlobal() {
3
- try {
4
- // Use variable to prevent Vite's static import analysis from failing on older vitest
5
- const runtimePath = 'vitest/' + 'runtime';
6
- return (await import(/* @vite-ignore */ runtimePath)).populateGlobal;
7
- }
8
- catch {
9
- return (await import('vitest/environments')).populateGlobal;
10
- }
11
- }
1
+ import { createRequire } from 'node:module';
2
+ import { pathToFileURL } from 'node:url';
12
3
  import happyDom from './env/happy-dom.js';
13
4
  import jsdom from './env/jsdom.js';
14
5
  import mockDoc from './env/mock-doc.js';
6
+ const require = createRequire(import.meta.url);
7
+ // Vitest 4 replaced `transformMode` with `viteEnvironment` and warns when the old field is still set.
8
+ const vitestMajor = Number.parseInt(require('vitest/package.json').version, 10);
9
+ const environmentOptions = vitestMajor >= 4 ? { viteEnvironment: 'ssr' } : { transformMode: 'ssr' };
10
+ // populateGlobal lives in vitest/runtime from Vitest 4.1 and in vitest/environments before that (removed in Vitest 5).
11
+ // The specifiers are variables because Vite fails to analyze an entry the installed Vitest lacks.
12
+ // The file URL is a fallback for Vitest 5 on Windows, whose two module runners each mishandle one form:
13
+ // the one that loads environments rejects the URL, and the one that runs test code (where this module
14
+ // ends up when it is imported directly) resolves the bare specifier against the cwd.
15
+ async function getPopulateGlobal() {
16
+ let error;
17
+ for (const entry of ['vitest/runtime', 'vitest/environments']) {
18
+ let resolved;
19
+ try {
20
+ resolved = require.resolve(entry);
21
+ }
22
+ catch {
23
+ continue;
24
+ }
25
+ for (const specifier of [entry, pathToFileURL(resolved).href]) {
26
+ try {
27
+ return (await import(/* @vite-ignore */ specifier)).populateGlobal;
28
+ }
29
+ catch (e) {
30
+ error ??= e;
31
+ }
32
+ }
33
+ }
34
+ throw new Error('@stencil/vitest: could not load populateGlobal from the installed version of vitest', {
35
+ cause: error,
36
+ });
37
+ }
15
38
  const environmentMap = {
16
39
  'happy-dom': happyDom,
17
40
  jsdom: jsdom,
@@ -34,9 +57,9 @@ const environmentMap = {
34
57
  * })
35
58
  * ```
36
59
  */
37
- export default {
60
+ const environment = {
38
61
  name: 'stencil',
39
- viteEnvironment: 'ssr',
62
+ ...environmentOptions,
40
63
  async setup(global, options) {
41
64
  const { stencil = {} } = options;
42
65
  const domEnvironment = stencil.domEnvironment || 'mock-doc';
@@ -67,6 +90,14 @@ export default {
67
90
  if (!win.process.env.NODE_ENV) {
68
91
  win.process.env.NODE_ENV = 'test';
69
92
  }
93
+ // Vitest 2–4 store values in originals; Vitest 5 stores descriptors.
94
+ // Capture descriptors ourselves so both preserve the native globals.
95
+ const originalDescriptors = Object.getOwnPropertyDescriptors(global);
96
+ const restoreGlobal = (key) => {
97
+ const descriptor = originalDescriptors[key];
98
+ if (descriptor)
99
+ Object.defineProperty(global, key, descriptor);
100
+ };
70
101
  // Populate global with window properties
71
102
  const populateGlobal = await getPopulateGlobal();
72
103
  const { keys, originals } = populateGlobal(global, win, {
@@ -75,7 +106,7 @@ export default {
75
106
  // Restore Node's native Event constructor (chai needs this)
76
107
  // CustomEvent can stay as mock-doc's version since it's needed for event creation
77
108
  if (originals.has('Event')) {
78
- global.Event = originals.get('Event');
109
+ restoreGlobal('Event');
79
110
  }
80
111
  // Create HTMLElement wrapper that captures ownerDocument
81
112
  // In Stencil 4.43+, win.HTMLElement returns MockHTMLElement directly which expects
@@ -83,7 +114,7 @@ export default {
83
114
  // super() with no args (standard browser behavior). This wrapper bridges the gap.
84
115
  const MockHTMLElementBase = global.HTMLElement;
85
116
  const doc = win.document;
86
- global.HTMLElement = class extends MockHTMLElementBase {
117
+ const HTMLElement = class extends MockHTMLElementBase {
87
118
  constructor() {
88
119
  super(doc, '');
89
120
  const observedAttributes = this.constructor.observedAttributes;
@@ -97,10 +128,11 @@ export default {
97
128
  }
98
129
  }
99
130
  };
131
+ Object.defineProperty(global, 'HTMLElement', { value: HTMLElement, writable: true, configurable: true });
100
132
  // Remove undefined properties that shadow native globals
101
133
  keys.forEach((key) => {
102
134
  if (global[key] === undefined && originals.has(key)) {
103
- global[key] = originals.get(key);
135
+ restoreGlobal(key);
104
136
  }
105
137
  });
106
138
  return {
@@ -111,8 +143,9 @@ export default {
111
143
  envTeardown();
112
144
  // Then clean up populated globals
113
145
  keys.forEach((key) => delete global[key]);
114
- originals.forEach((v, k) => (global[k] = v));
146
+ originals.forEach((_, key) => restoreGlobal(key));
115
147
  },
116
148
  };
117
149
  },
118
150
  };
151
+ export default environment;
@@ -3,57 +3,57 @@
3
3
  *
4
4
  * These extend Vitest's expect with Stencil-specific assertions
5
5
  */
6
- /**
7
- * Custom matchers interface
8
- */
9
- interface CustomMatchers<R = unknown> {
6
+ type MatcherResult<T> = T extends {
7
+ toBe: (...args: any[]) => infer R;
8
+ } ? R : unknown;
9
+ interface CustomMatchers {
10
10
  /** Asserts element has the specified CSS class. */
11
- toHaveClass(className: string): R;
11
+ toHaveClass(className: string): MatcherResult<this>;
12
12
  /** Asserts element has all specified CSS classes. */
13
- toHaveClasses(classNames: string[]): R;
13
+ toHaveClasses(classNames: string[]): MatcherResult<this>;
14
14
  /** Asserts element has exactly the specified CSS classes (no more, no less). */
15
- toMatchClasses(classNames: string[]): R;
15
+ toMatchClasses(classNames: string[]): MatcherResult<this>;
16
16
  /** Asserts element has the attribute, optionally with a specific value. */
17
- toHaveAttribute(attribute: string, value?: string): R;
17
+ toHaveAttribute(attribute: string, value?: string): MatcherResult<this>;
18
18
  /** Asserts element attribute equals the expected value exactly. */
19
- toEqualAttribute(attribute: string, value: string): R;
19
+ toEqualAttribute(attribute: string, value: string): MatcherResult<this>;
20
20
  /** Asserts element has all specified attributes with exact values. */
21
- toEqualAttributes(expectedAttrs: Record<string, string>): R;
22
- /** Asserts element has the property, optionally with a specific value. */
23
- toHaveProperty(property: string, value?: any): R;
21
+ toEqualAttributes(expectedAttrs: Record<string, string>): MatcherResult<this>;
24
22
  /** Asserts element's text content (including shadow DOM) contains the specified text. */
25
- toHaveTextContent(text: string): R;
23
+ toHaveTextContent(text: string): MatcherResult<this>;
26
24
  /** Asserts element's light DOM text content contains the specified text. */
27
- toHaveLightTextContent(text: string): R;
25
+ toHaveLightTextContent(text: string): MatcherResult<this>;
28
26
  /** Asserts element's trimmed text content (including shadow DOM) equals the expected text exactly. */
29
- toEqualText(expectedText: string): R;
27
+ toEqualText(expectedText: string): MatcherResult<this>;
30
28
  /** Asserts element's trimmed light DOM text content (excluding shadow DOM) equals the expected text exactly. */
31
- toEqualLightText(expectedText: string): R;
29
+ toEqualLightText(expectedText: string): MatcherResult<this>;
32
30
  /** Asserts element has an attached shadow root. */
33
- toHaveShadowRoot(): R;
31
+ toHaveShadowRoot(): MatcherResult<this>;
34
32
  /** Asserts element's serialized HTML (including shadow DOM) matches expected HTML. */
35
- toEqualHtml(expectedHtml: string): R;
33
+ toEqualHtml(expectedHtml: string): MatcherResult<this>;
36
34
  /** Asserts element's light DOM HTML (excluding shadow DOM internals) matches expected HTML. */
37
- toEqualLightHtml(expectedHtml: string): R;
35
+ toEqualLightHtml(expectedHtml: string): MatcherResult<this>;
38
36
  /** Asserts event spy has received at least one event. */
39
- toHaveReceivedEvent(): R;
37
+ toHaveReceivedEvent(): MatcherResult<this>;
40
38
  /** Asserts event spy has received exactly the specified number of events. */
41
- toHaveReceivedEventTimes(count: number): R;
39
+ toHaveReceivedEventTimes(count: number): MatcherResult<this>;
42
40
  /** Asserts event spy's last received event has the expected detail. */
43
- toHaveReceivedEventDetail(detail: any): R;
41
+ toHaveReceivedEventDetail(detail: any): MatcherResult<this>;
44
42
  /** Asserts event spy's first received event has the expected detail. */
45
- toHaveFirstReceivedEventDetail(detail: any): R;
43
+ toHaveFirstReceivedEventDetail(detail: any): MatcherResult<this>;
46
44
  /** Asserts event spy's last received event has the expected detail. */
47
- toHaveLastReceivedEventDetail(detail: any): R;
45
+ toHaveLastReceivedEventDetail(detail: any): MatcherResult<this>;
48
46
  /** Asserts event spy's nth received event (0-indexed) has the expected detail. */
49
- toHaveNthReceivedEventDetail(index: number, detail: any): R;
47
+ toHaveNthReceivedEventDetail(index: number, detail: any): MatcherResult<this>;
50
48
  }
51
49
  declare module 'vitest' {
52
- interface Assertion<T = any> extends CustomMatchers<T> {
53
- }
54
- interface Matchers<T = any, R = T> extends CustomMatchers<R> {
50
+ interface Assertion extends CustomMatchers {
51
+ toHaveClass(className: string): MatcherResult<this>;
52
+ toHaveAttribute(attribute: string, value?: string): MatcherResult<this>;
53
+ toHaveTextContent(text: string): MatcherResult<this>;
55
54
  }
56
55
  interface AsymmetricMatchersContaining extends CustomMatchers {
56
+ toHaveProperty(property: string, value?: any): unknown;
57
57
  }
58
58
  }
59
59
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"matchers.d.ts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5D,wEAAwE;IACxE,8BAA8B,CAAC,MAAM,EAAE,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IACjE,uEAAuE;IACvE,6BAA6B,CAAC,MAAM,EAAE,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAChE,kFAAkF;IAClF,4BAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;CAC/E;AAGD,OAAO,QAAQ,QAAQ,CAAC;IACtB,UAAU,SAAU,SAAQ,cAAc;QAExC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QACpD,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QACxE,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;KACtD;IACD,UAAU,4BAA6B,SAAQ,cAAc;QAC3D,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC;KACxD;CACF;AAioBD,OAAO,EAAE,CAAC"}
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.15.1",
7
+ "version": "1.16.0",
8
8
  "description": "First-class testing utilities for Stencil design systems with Vitest",
9
9
  "license": "MIT",
10
10
  "type": "module",
@@ -77,7 +77,7 @@
77
77
  },
78
78
  "peerDependencies": {
79
79
  "@stencil/core": "^4.0.0 || >=5.0.0-alpha.0 <5.0.0-next.0 || ^5.0.0",
80
- "vitest": "^4.0.0 || ^3.0.0 || ^2.0.0"
80
+ "vitest": "^5.0.0 || ^4.0.0 || ^3.0.0 || ^2.0.0"
81
81
  },
82
82
  "peerDependenciesMeta": {
83
83
  "@playwright/test": {
@@ -111,34 +111,37 @@
111
111
  "dependencies": {
112
112
  "jiti": "^2.6.1",
113
113
  "local-pkg": "^1.1.2",
114
- "vitest-environment-stencil": "1.15.1"
114
+ "vitest-environment-stencil": "1.16.0"
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/core": "^4.0.0 || >=5.0.0-alpha.0 <5.0.0-next.0 || ^5.0.0",
122
121
  "@stencil/cli": "^5.0.0 || >=5.0.0-alpha.0 <5.0.0-next.0",
122
+ "@stencil/core": "^4.0.0 || >=5.0.0-alpha.0 <5.0.0-next.0 || ^5.0.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",
126
- "@vitest/coverage-v8": "^4.1.0",
126
+ "@vitest/browser": "^5.0.3",
127
+ "@vitest/coverage-v8": "^5.0.3",
127
128
  "eslint": "^9.39.2",
129
+ "happy-dom": "^20.0.11",
128
130
  "installed-check": "^9.3.0",
131
+ "jsdom": "^27.3.0",
129
132
  "knip": "^5.76.3",
130
133
  "prettier": "^3.7.4",
131
134
  "semantic-release": "^25.0.2",
132
135
  "typescript": "~5.8.3",
133
- "vitest": "^4.1.0"
136
+ "vitest": "^5.0.3"
134
137
  },
135
138
  "engines": {
136
- "node": "^20.0.0 || ^22.0.0 || >=24.0.0"
139
+ "node": "^22.12.0 || ^24.0.0 || >=26.0.0"
137
140
  },
138
141
  "scripts": {
139
142
  "build": "tsc && tsc -p tsconfig.bin.json && cp src/globals.d.ts dist/globals.d.ts",
140
143
  "dev": "tsc --watch",
141
- "test:e2e": "pnpm --filter test-project test",
144
+ "test:e2e": "pnpm --filter test-project --filter test-env-comments test",
142
145
  "test:unit": "vitest run",
143
146
  "test:unit:watch": "vitest",
144
147
  "test:engines": "pnpm installed-check --no-workspaces --ignore-dev",
@@ -149,6 +152,7 @@
149
152
  "knip": "knip",
150
153
  "quality": "pnpm format && pnpm lint && pnpm knip",
151
154
  "quality:fix": "pnpm format:fix && pnpm lint:fix && pnpm knip",
152
- "release": "semantic-release"
155
+ "release": "semantic-release",
156
+ "test:types": "tsc -p tsconfig.types.json"
153
157
  }
154
158
  }