@analogjs/vitest-angular 3.0.0-alpha.64 → 3.0.0-alpha.65

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
@@ -128,6 +128,8 @@ The `setupTestBed()` function accepts an optional configuration object with the
128
128
  - `zoneless` (boolean): Whether to use zoneless change detection (default: `true`)
129
129
  - `providers` (`Type<any>[]`): Additional providers to include in the test environment (default: `[]`)
130
130
  - `teardown.destroyAfterEach` (boolean): Whether to destroy the test environment after each test. Set to `false` to keep the component rendered, allowing you to inspect its final state. (default: `true`)
131
+ - `errorOnUnknownElements` (boolean): Whether to throw when unknown elements are present in a component's template. Set to `false` (default) to log the error instead of throwing.
132
+ - `errorOnUnknownProperties` (boolean): Whether to throw when unknown properties are present in a component's template. Set to `false` (default) to log the error instead of throwing.
131
133
 
132
134
  **Example with options:**
133
135
 
@@ -136,6 +138,8 @@ setupTestBed({
136
138
  zoneless: true,
137
139
  providers: [],
138
140
  teardown: { destroyAfterEach: false },
141
+ errorOnUnknownElements: true,
142
+ errorOnUnknownProperties: true,
139
143
  });
140
144
  ```
141
145
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@analogjs/vitest-angular",
3
- "version": "3.0.0-alpha.64",
3
+ "version": "3.0.0-alpha.65",
4
4
  "description": "Vitest Builder for Angular",
5
5
  "type": "module",
6
6
  "author": "Brandon Roberts <robertsbt@gmail.com>",
@@ -10,6 +10,8 @@ type TestBedSetupOptions = {
10
10
  teardown?: {
11
11
  destroyAfterEach: boolean;
12
12
  };
13
+ errorOnUnknownElements?: boolean;
14
+ errorOnUnknownProperties?: boolean;
13
15
  };
14
- export declare function setupTestBed({ zoneless, providers, browserMode, teardown }?: TestBedSetupOptions): void;
16
+ export declare function setupTestBed({ zoneless, providers, browserMode, teardown, errorOnUnknownElements, errorOnUnknownProperties }?: TestBedSetupOptions): void;
15
17
  export {};
package/setup-testbed.js CHANGED
@@ -5,17 +5,21 @@ import { BrowserTestingModule, platformBrowserTesting } from "@angular/platform-
5
5
  import { afterEach, beforeEach } from "vitest";
6
6
  //#region packages/vitest-angular/setup-testbed.ts
7
7
  var ANGULAR_TESTBED_SETUP = Symbol.for("testbed-setup");
8
- function setupTestBed({ zoneless = true, providers = [], browserMode = false, teardown } = {}) {
8
+ function setupTestBed({ zoneless = true, providers = [], browserMode = false, teardown, errorOnUnknownElements, errorOnUnknownProperties } = {}) {
9
9
  beforeEach(ɵgetCleanupHook(false));
10
10
  afterEach(ɵgetCleanupHook(true));
11
11
  if (!globalThis[ANGULAR_TESTBED_SETUP]) {
12
12
  globalThis[ANGULAR_TESTBED_SETUP] = true;
13
13
  let TestModule = class TestModule {};
14
14
  TestModule = __decorate([NgModule({ providers: [...zoneless ? [provideZonelessChangeDetection()] : [], ...providers] })], TestModule);
15
- getTestBed().initTestEnvironment([BrowserTestingModule, TestModule], platformBrowserTesting(), { teardown: {
16
- destroyAfterEach: !browserMode,
17
- ...teardown
18
- } });
15
+ getTestBed().initTestEnvironment([BrowserTestingModule, TestModule], platformBrowserTesting(), {
16
+ teardown: {
17
+ destroyAfterEach: !browserMode,
18
+ ...teardown
19
+ },
20
+ errorOnUnknownElements,
21
+ errorOnUnknownProperties
22
+ });
19
23
  }
20
24
  }
21
25
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"setup-testbed.js","names":[],"sources":["../setup-testbed.ts"],"sourcesContent":["import {\n EnvironmentProviders,\n NgModule,\n Provider,\n provideZonelessChangeDetection,\n} from '@angular/core';\nimport {\n ɵgetCleanupHook as getCleanupHook,\n getTestBed,\n} from '@angular/core/testing';\nimport {\n BrowserTestingModule,\n platformBrowserTesting,\n} from '@angular/platform-browser/testing';\nimport { afterEach, beforeEach } from 'vitest';\n\nconst ANGULAR_TESTBED_SETUP = Symbol.for('testbed-setup');\n\ntype TestBedSetupOptions = {\n zoneless?: boolean;\n providers?: (Provider | EnvironmentProviders)[];\n /**\n * @deprecated Use `teardown.destroyAfterEach` instead.\n * @sunset 3.0.0\n */\n browserMode?: boolean;\n teardown?: {\n destroyAfterEach: boolean;\n };\n};\n\nexport function setupTestBed({\n zoneless = true,\n providers = [],\n browserMode = false,\n teardown,\n}: TestBedSetupOptions = {}): void {\n beforeEach(getCleanupHook(false));\n afterEach(getCleanupHook(true));\n\n if (!(globalThis as any)[ANGULAR_TESTBED_SETUP]) {\n (globalThis as any)[ANGULAR_TESTBED_SETUP] = true;\n\n @NgModule({\n providers: [\n ...(zoneless ? [provideZonelessChangeDetection()] : []),\n ...providers,\n ],\n })\n class TestModule {}\n\n getTestBed().initTestEnvironment(\n [BrowserTestingModule, TestModule],\n platformBrowserTesting(),\n {\n teardown: {\n ...{ destroyAfterEach: !browserMode },\n ...teardown,\n },\n },\n );\n }\n}\n"],"mappings":";;;;;;AAgBA,IAAM,wBAAwB,OAAO,IAAI,gBAAgB;AAezD,SAAgB,aAAa,EAC3B,WAAW,MACX,YAAY,EAAE,EACd,cAAc,OACd,aACuB,EAAE,EAAQ;AACjC,YAAW,gBAAe,MAAM,CAAC;AACjC,WAAU,gBAAe,KAAK,CAAC;AAE/B,KAAI,CAAE,WAAmB,wBAAwB;AAC9C,aAAmB,yBAAyB;EAE7C,IAAA,aAAA,MAMM,WAAW;2BANhB,SAAS,EACR,WAAW,CACT,GAAI,WAAW,CAAC,gCAAgC,CAAC,GAAG,EAAE,EACtD,GAAG,UACJ,EACF,CAAC,CAAA,EAAA,WAAA;AAGF,cAAY,CAAC,oBACX,CAAC,sBAAsB,WAAW,EAClC,wBAAwB,EACxB,EACE,UAAU;GACH,kBAAkB,CAAC;GACxB,GAAG;GACJ,EACF,CACF"}
1
+ {"version":3,"file":"setup-testbed.js","names":[],"sources":["../setup-testbed.ts"],"sourcesContent":["import {\n EnvironmentProviders,\n NgModule,\n Provider,\n provideZonelessChangeDetection,\n} from '@angular/core';\nimport {\n ɵgetCleanupHook as getCleanupHook,\n getTestBed,\n} from '@angular/core/testing';\nimport {\n BrowserTestingModule,\n platformBrowserTesting,\n} from '@angular/platform-browser/testing';\nimport { afterEach, beforeEach } from 'vitest';\n\nconst ANGULAR_TESTBED_SETUP = Symbol.for('testbed-setup');\n\ntype TestBedSetupOptions = {\n zoneless?: boolean;\n providers?: (Provider | EnvironmentProviders)[];\n /**\n * @deprecated Use `teardown.destroyAfterEach` instead.\n * @sunset 3.0.0\n */\n browserMode?: boolean;\n teardown?: {\n destroyAfterEach: boolean;\n };\n errorOnUnknownElements?: boolean;\n errorOnUnknownProperties?: boolean;\n};\n\nexport function setupTestBed({\n zoneless = true,\n providers = [],\n browserMode = false,\n teardown,\n errorOnUnknownElements,\n errorOnUnknownProperties,\n}: TestBedSetupOptions = {}): void {\n beforeEach(getCleanupHook(false));\n afterEach(getCleanupHook(true));\n\n if (!(globalThis as any)[ANGULAR_TESTBED_SETUP]) {\n (globalThis as any)[ANGULAR_TESTBED_SETUP] = true;\n\n @NgModule({\n providers: [\n ...(zoneless ? [provideZonelessChangeDetection()] : []),\n ...providers,\n ],\n })\n class TestModule {}\n\n getTestBed().initTestEnvironment(\n [BrowserTestingModule, TestModule],\n platformBrowserTesting(),\n {\n teardown: {\n ...{ destroyAfterEach: !browserMode },\n ...teardown,\n },\n errorOnUnknownElements,\n errorOnUnknownProperties,\n },\n );\n }\n}\n"],"mappings":";;;;;;AAgBA,IAAM,wBAAwB,OAAO,IAAI,gBAAgB;AAiBzD,SAAgB,aAAa,EAC3B,WAAW,MACX,YAAY,EAAE,EACd,cAAc,OACd,UACA,wBACA,6BACuB,EAAE,EAAQ;AACjC,YAAW,gBAAe,MAAM,CAAC;AACjC,WAAU,gBAAe,KAAK,CAAC;AAE/B,KAAI,CAAE,WAAmB,wBAAwB;AAC9C,aAAmB,yBAAyB;EAE7C,IAAA,aAAA,MAMM,WAAW;2BANhB,SAAS,EACR,WAAW,CACT,GAAI,WAAW,CAAC,gCAAgC,CAAC,GAAG,EAAE,EACtD,GAAG,UACJ,EACF,CAAC,CAAA,EAAA,WAAA;AAGF,cAAY,CAAC,oBACX,CAAC,sBAAsB,WAAW,EAClC,wBAAwB,EACxB;GACE,UAAU;IACH,kBAAkB,CAAC;IACxB,GAAG;IACJ;GACD;GACA;GACD,CACF"}
package/setup-zone.d.ts CHANGED
@@ -2,4 +2,5 @@ import "zone.js";
2
2
  import "zone.js/plugins/sync-test";
3
3
  import "zone.js/plugins/proxy";
4
4
  import "zone.js/testing";
5
+ import "./setup-snapshots.js";
5
6
  export {};
package/setup-zone.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createAngularFixtureSnapshotSerializer } from "./src/lib/snapshot-serializers/angular-fixture.js";
1
+ import "./setup-snapshots.js";
2
2
  import "zone.js";
3
3
  import "zone.js/plugins/sync-test";
4
4
  import "zone.js/plugins/proxy";
@@ -10,95 +10,94 @@ import "zone.js/testing";
10
10
  */
11
11
  var Zone = globalThis["Zone"];
12
12
  if (Zone === void 0) throw new Error("Missing: Zone (zone.js)");
13
- if (globalThis["__vitest_zone_patch__"] === true) throw new Error("'vitest' has already been patched with 'Zone'.");
14
- globalThis["__vitest_zone_patch__"] = true;
15
- var SyncTestZoneSpec = Zone["SyncTestZoneSpec"];
16
- var ProxyZoneSpec = Zone["ProxyZoneSpec"];
17
- if (SyncTestZoneSpec === void 0) throw new Error("Missing: SyncTestZoneSpec (zone.js/plugins/sync-test)");
18
- if (ProxyZoneSpec === void 0) throw new Error("Missing: ProxyZoneSpec (zone.js/plugins/proxy.js)");
19
- var env = globalThis;
20
- var ambientZone = Zone.current;
21
- var originalExpect = env["expect"];
22
- if (originalExpect) originalExpect.addSnapshotSerializer(createAngularFixtureSnapshotSerializer());
23
- var syncZone = ambientZone.fork(new SyncTestZoneSpec("vitest.describe"));
24
- function wrapDescribeInZone(describeBody) {
25
- return function(...args) {
26
- return syncZone.run(describeBody, null, args);
13
+ if (globalThis["__vitest_zone_patch__"] !== true) {
14
+ globalThis["__vitest_zone_patch__"] = true;
15
+ const SyncTestZoneSpec = Zone["SyncTestZoneSpec"];
16
+ const ProxyZoneSpec = Zone["ProxyZoneSpec"];
17
+ if (SyncTestZoneSpec === void 0) throw new Error("Missing: SyncTestZoneSpec (zone.js/plugins/sync-test)");
18
+ if (ProxyZoneSpec === void 0) throw new Error("Missing: ProxyZoneSpec (zone.js/plugins/proxy.js)");
19
+ const env = globalThis;
20
+ const ambientZone = Zone.current;
21
+ const syncZone = ambientZone.fork(new SyncTestZoneSpec("vitest.describe"));
22
+ const wrapDescribeInZone = function(describeBody) {
23
+ return function(...args) {
24
+ return syncZone.run(describeBody, null, args);
25
+ };
27
26
  };
28
- }
29
- var testProxyZone = ambientZone.fork(new ProxyZoneSpec());
30
- function wrapTestInZone(testBody) {
31
- if (testBody === void 0) return;
32
- const wrappedFunc = function(...args) {
33
- return testProxyZone.run(testBody, null, args);
27
+ const testProxyZone = ambientZone.fork(new ProxyZoneSpec());
28
+ const wrapTestInZone = function(testBody) {
29
+ if (testBody === void 0) return;
30
+ const wrappedFunc = function() {
31
+ return testProxyZone.run(testBody, null, arguments);
32
+ };
33
+ try {
34
+ Object.defineProperty(wrappedFunc, "length", {
35
+ configurable: true,
36
+ writable: true,
37
+ enumerable: false
38
+ });
39
+ wrappedFunc.length = testBody.length;
40
+ } catch (e) {
41
+ return testBody.length === 0 ? () => testProxyZone.run(testBody, null) : (done) => testProxyZone.run(testBody, null, [done]);
42
+ }
43
+ return wrappedFunc;
34
44
  };
35
- try {
36
- Object.defineProperty(wrappedFunc, "length", {
37
- configurable: true,
38
- writable: true,
39
- enumerable: false
40
- });
41
- wrappedFunc.length = testBody.length;
42
- } catch (e) {
43
- return testBody.length === 0 ? () => testProxyZone.run(testBody, null) : (done) => testProxyZone.run(testBody, null, [done]);
44
- }
45
- return wrappedFunc;
46
- }
47
- /**
48
- * bind describe method to wrap describe.each function
49
- */
50
- var bindDescribe = (self, originalVitestFn) => function(...eachArgs) {
51
- return function(...args) {
52
- args[1] = wrapDescribeInZone(args[1]);
53
- return originalVitestFn.apply(self, eachArgs).apply(self, args);
45
+ /**
46
+ * bind describe method to wrap describe.each function
47
+ */
48
+ const bindDescribe = (self, originalVitestFn) => function(...eachArgs) {
49
+ return function(...args) {
50
+ args[1] = wrapDescribeInZone(args[1]);
51
+ return originalVitestFn.apply(self, eachArgs).apply(self, args);
52
+ };
54
53
  };
55
- };
56
- /**
57
- * bind test method to wrap test.each function
58
- */
59
- var bindTest = (self, originalVitestFn) => function(...eachArgs) {
60
- return function(...args) {
61
- args[1] = wrapTestInZone(args[1]);
62
- return originalVitestFn.apply(self, eachArgs).apply(self, args);
54
+ /**
55
+ * bind test method to wrap test.each function
56
+ */
57
+ const bindTest = (self, originalVitestFn) => function(...eachArgs) {
58
+ return function(...args) {
59
+ args[1] = wrapTestInZone(args[1]);
60
+ return originalVitestFn.apply(self, eachArgs).apply(self, args);
61
+ };
63
62
  };
64
- };
65
- ["describe"].forEach((methodName) => {
66
- const originalvitestFn = env[methodName];
67
- env[methodName] = function(...args) {
68
- args[1] = wrapDescribeInZone(args[1]);
69
- return originalvitestFn.apply(this, args);
70
- };
71
- env[methodName].each = bindDescribe(originalvitestFn, originalvitestFn.each);
72
- if (methodName === "describe") {
73
- env[methodName].only = bindDescribe(originalvitestFn, originalvitestFn.only);
74
- env[methodName].skip = bindDescribe(originalvitestFn, originalvitestFn.skip);
75
- }
76
- });
77
- ["test", "it"].forEach((methodName) => {
78
- const originalvitestFn = env[methodName];
79
- env[methodName] = function(...args) {
80
- args[1] = wrapTestInZone(args[1]);
81
- return originalvitestFn.apply(this, args);
82
- };
83
- env[methodName].each = bindTest(originalvitestFn, originalvitestFn.each);
84
- env[methodName].only = bindTest(originalvitestFn, originalvitestFn.only);
85
- env[methodName].skip = bindTest(originalvitestFn, originalvitestFn.skip);
86
- if (methodName === "test" || methodName === "it") env[methodName].todo = function(...args) {
87
- return originalvitestFn.todo.apply(this, args);
88
- };
89
- });
90
- [
91
- "beforeEach",
92
- "afterEach",
93
- "beforeAll",
94
- "afterAll"
95
- ].forEach((methodName) => {
96
- const originalvitestFn = env[methodName];
97
- env[methodName] = function(...args) {
98
- args[0] = wrapTestInZone(args[0]);
99
- return originalvitestFn.apply(this, args);
100
- };
101
- });
63
+ ["describe"].forEach((methodName) => {
64
+ const originalvitestFn = env[methodName];
65
+ env[methodName] = function(...args) {
66
+ args[1] = wrapDescribeInZone(args[1]);
67
+ return originalvitestFn.apply(this, args);
68
+ };
69
+ env[methodName].each = bindDescribe(originalvitestFn, originalvitestFn.each);
70
+ if (methodName === "describe") {
71
+ env[methodName].only = bindDescribe(originalvitestFn, originalvitestFn.only);
72
+ env[methodName].skip = bindDescribe(originalvitestFn, originalvitestFn.skip);
73
+ }
74
+ });
75
+ ["test", "it"].forEach((methodName) => {
76
+ const originalvitestFn = env[methodName];
77
+ env[methodName] = function(...args) {
78
+ args[1] = wrapTestInZone(args[1]);
79
+ return originalvitestFn.apply(this, args);
80
+ };
81
+ env[methodName].each = bindTest(originalvitestFn, originalvitestFn.each);
82
+ env[methodName].only = bindTest(originalvitestFn, originalvitestFn.only);
83
+ env[methodName].skip = bindTest(originalvitestFn, originalvitestFn.skip);
84
+ if (methodName === "test" || methodName === "it") env[methodName].todo = function(...args) {
85
+ return originalvitestFn.todo.apply(this, args);
86
+ };
87
+ });
88
+ [
89
+ "beforeEach",
90
+ "afterEach",
91
+ "beforeAll",
92
+ "afterAll"
93
+ ].forEach((methodName) => {
94
+ const originalvitestFn = env[methodName];
95
+ env[methodName] = function(...args) {
96
+ args[0] = wrapTestInZone(args[0]);
97
+ return originalvitestFn.apply(this, args);
98
+ };
99
+ });
100
+ }
102
101
  //#endregion
103
102
 
104
103
  //# sourceMappingURL=setup-zone.js.map
package/setup-zone.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"setup-zone.js","names":[],"sources":["../setup-zone.ts"],"sourcesContent":["import 'zone.js';\nimport 'zone.js/plugins/sync-test';\nimport 'zone.js/plugins/proxy';\nimport 'zone.js/testing';\n\nimport { createAngularFixtureSnapshotSerializer } from './snapshot-serializers.js';\n/**\n * Patch Vitest's describe/test/beforeEach/afterEach functions so test code\n * always runs in a testZone (ProxyZone).\n */\n/* global Zone */\nconst Zone = (globalThis as any)['Zone'];\n\nif (Zone === undefined) {\n throw new Error('Missing: Zone (zone.js)');\n}\n\nif ((globalThis as any)['__vitest_zone_patch__'] === true) {\n throw new Error(\"'vitest' has already been patched with 'Zone'.\");\n}\n\n(globalThis as any)['__vitest_zone_patch__'] = true;\nconst SyncTestZoneSpec = Zone['SyncTestZoneSpec'];\nconst ProxyZoneSpec = Zone['ProxyZoneSpec'];\n\nif (SyncTestZoneSpec === undefined) {\n throw new Error('Missing: SyncTestZoneSpec (zone.js/plugins/sync-test)');\n}\nif (ProxyZoneSpec === undefined) {\n throw new Error('Missing: ProxyZoneSpec (zone.js/plugins/proxy.js)');\n}\n\nconst env = globalThis as any;\nconst ambientZone = Zone.current;\n\nconst originalExpect = env['expect'];\nif (originalExpect) {\n originalExpect.addSnapshotSerializer(\n createAngularFixtureSnapshotSerializer(),\n );\n}\n\n// Create a synchronous-only zone in which to run `describe` blocks in order to\n// raise an error if any asynchronous operations are attempted\n// inside of a `describe` but outside of a `beforeEach` or `it`.\nconst syncZone = ambientZone.fork(new SyncTestZoneSpec('vitest.describe'));\nfunction wrapDescribeInZone(describeBody: any) {\n return function (...args: any) {\n return syncZone.run(describeBody, null, args);\n };\n}\n\n// Create a proxy zone in which to run `test` blocks so that the tests function\n// can retroactively install different zones.\nconst testProxyZone = ambientZone.fork(new ProxyZoneSpec());\nfunction wrapTestInZone(testBody: string | any[] | undefined) {\n if (testBody === undefined) {\n return;\n }\n\n const wrappedFunc = function (...args: any[]) {\n return testProxyZone.run(testBody, null, args);\n };\n try {\n Object.defineProperty(wrappedFunc, 'length', {\n configurable: true,\n writable: true,\n enumerable: false,\n });\n wrappedFunc.length = testBody.length;\n } catch (e) {\n return testBody.length === 0\n ? () => testProxyZone.run(testBody, null)\n : (done: any) => testProxyZone.run(testBody, null, [done]);\n }\n\n return wrappedFunc;\n}\n\n/**\n * bind describe method to wrap describe.each function\n */\nconst bindDescribe = (\n self: any,\n originalVitestFn: {\n apply: (\n arg0: any,\n arg1: any[],\n ) => {\n (): any;\n new (): any;\n apply: { (arg0: any, arg1: any[]): any; new (): any };\n };\n },\n) =>\n function (...eachArgs: any) {\n return function (...args: any[]) {\n args[1] = wrapDescribeInZone(args[1]);\n\n return originalVitestFn.apply(self, eachArgs).apply(self, args);\n };\n };\n\n/**\n * bind test method to wrap test.each function\n */\nconst bindTest = (\n self: any,\n originalVitestFn: {\n apply: (\n arg0: any,\n arg1: any[],\n ) => {\n (): any;\n new (): any;\n apply: { (arg0: any, arg1: any[]): any; new (): any };\n };\n },\n) =>\n function (...eachArgs: any) {\n return function (...args: any[]) {\n args[1] = wrapTestInZone(args[1]);\n\n return originalVitestFn.apply(self, eachArgs).apply(self, args);\n };\n };\n\n['describe'].forEach((methodName) => {\n const originalvitestFn = env[methodName];\n env[methodName] = function (...args: any[]) {\n args[1] = wrapDescribeInZone(args[1]);\n\n return originalvitestFn.apply(this, args);\n };\n env[methodName].each = bindDescribe(originalvitestFn, originalvitestFn.each);\n if (methodName === 'describe') {\n env[methodName].only = bindDescribe(\n originalvitestFn,\n originalvitestFn.only,\n );\n env[methodName].skip = bindDescribe(\n originalvitestFn,\n originalvitestFn.skip,\n );\n }\n});\n\n['test', 'it'].forEach((methodName) => {\n const originalvitestFn = env[methodName];\n env[methodName] = function (...args: any[]) {\n args[1] = wrapTestInZone(args[1]);\n\n return originalvitestFn.apply(this, args);\n };\n env[methodName].each = bindTest(originalvitestFn, originalvitestFn.each);\n env[methodName].only = bindTest(originalvitestFn, originalvitestFn.only);\n env[methodName].skip = bindTest(originalvitestFn, originalvitestFn.skip);\n\n if (methodName === 'test' || methodName === 'it') {\n env[methodName].todo = function (...args: any) {\n return originalvitestFn.todo.apply(this, args);\n };\n }\n});\n\n['beforeEach', 'afterEach', 'beforeAll', 'afterAll'].forEach((methodName) => {\n const originalvitestFn = env[methodName];\n\n env[methodName] = function (...args: any[]) {\n args[0] = wrapTestInZone(args[0]);\n\n return originalvitestFn.apply(this, args);\n };\n});\n"],"mappings":";;;;;;;;;;AAWA,IAAM,OAAQ,WAAmB;AAEjC,IAAI,SAAS,KAAA,EACX,OAAM,IAAI,MAAM,0BAA0B;AAG5C,IAAK,WAAmB,6BAA6B,KACnD,OAAM,IAAI,MAAM,iDAAiD;AAGnE,WAAoB,2BAA2B;AAC/C,IAAM,mBAAmB,KAAK;AAC9B,IAAM,gBAAgB,KAAK;AAE3B,IAAI,qBAAqB,KAAA,EACvB,OAAM,IAAI,MAAM,wDAAwD;AAE1E,IAAI,kBAAkB,KAAA,EACpB,OAAM,IAAI,MAAM,oDAAoD;AAGtE,IAAM,MAAM;AACZ,IAAM,cAAc,KAAK;AAEzB,IAAM,iBAAiB,IAAI;AAC3B,IAAI,eACF,gBAAe,sBACb,wCAAwC,CACzC;AAMH,IAAM,WAAW,YAAY,KAAK,IAAI,iBAAiB,kBAAkB,CAAC;AAC1E,SAAS,mBAAmB,cAAmB;AAC7C,QAAO,SAAU,GAAG,MAAW;AAC7B,SAAO,SAAS,IAAI,cAAc,MAAM,KAAK;;;AAMjD,IAAM,gBAAgB,YAAY,KAAK,IAAI,eAAe,CAAC;AAC3D,SAAS,eAAe,UAAsC;AAC5D,KAAI,aAAa,KAAA,EACf;CAGF,MAAM,cAAc,SAAU,GAAG,MAAa;AAC5C,SAAO,cAAc,IAAI,UAAU,MAAM,KAAK;;AAEhD,KAAI;AACF,SAAO,eAAe,aAAa,UAAU;GAC3C,cAAc;GACd,UAAU;GACV,YAAY;GACb,CAAC;AACF,cAAY,SAAS,SAAS;UACvB,GAAG;AACV,SAAO,SAAS,WAAW,UACjB,cAAc,IAAI,UAAU,KAAK,IACtC,SAAc,cAAc,IAAI,UAAU,MAAM,CAAC,KAAK,CAAC;;AAG9D,QAAO;;;;;AAMT,IAAM,gBACJ,MACA,qBAWA,SAAU,GAAG,UAAe;AA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AAmB,IAAI;AAE7B,KAAI,cAAc,SAAU,GAAG,MAAa;AAC1C,OAAK,KAAK,eAAe,KAAK,GAAG;AAEjC,SAAO,iBAAiB,MAAM,MAAM,KAAK;;EAE3C"}
1
+ {"version":3,"file":"setup-zone.js","names":[],"sources":["../setup-zone.ts"],"sourcesContent":["import 'zone.js';\nimport 'zone.js/plugins/sync-test';\nimport 'zone.js/plugins/proxy';\nimport 'zone.js/testing';\n\nimport './setup-snapshots.js';\n/**\n * Patch Vitest's describe/test/beforeEach/afterEach functions so test code\n * always runs in a testZone (ProxyZone).\n */\n/* global Zone */\nconst Zone = (globalThis as any)['Zone'];\n\nif (Zone === undefined) {\n throw new Error('Missing: Zone (zone.js)');\n}\n\n// Setup files are re-executed for every test file in a reused worker\n// (e.g. isolate: false, or bundled setup entries). The patched functions\n// live on the same globalThis as this flag, so skip instead of re-patching.\nif ((globalThis as any)['__vitest_zone_patch__'] !== true) {\n (globalThis as any)['__vitest_zone_patch__'] = true;\n const SyncTestZoneSpec = Zone['SyncTestZoneSpec'];\n const ProxyZoneSpec = Zone['ProxyZoneSpec'];\n\n if (SyncTestZoneSpec === undefined) {\n throw new Error('Missing: SyncTestZoneSpec (zone.js/plugins/sync-test)');\n }\n if (ProxyZoneSpec === undefined) {\n throw new Error('Missing: ProxyZoneSpec (zone.js/plugins/proxy.js)');\n }\n\n const env = globalThis as any;\n const ambientZone = Zone.current;\n\n // Create a synchronous-only zone in which to run `describe` blocks in order to\n // raise an error if any asynchronous operations are attempted\n // inside of a `describe` but outside of a `beforeEach` or `it`.\n const syncZone = ambientZone.fork(new SyncTestZoneSpec('vitest.describe'));\n const wrapDescribeInZone = function (describeBody: any) {\n return function (...args: any) {\n return syncZone.run(describeBody, null, args);\n };\n };\n\n // Create a proxy zone in which to run `test` blocks so that the tests function\n // can retroactively install different zones.\n const testProxyZone = ambientZone.fork(new ProxyZoneSpec());\n const wrapTestInZone = function (testBody: string | any[] | undefined) {\n if (testBody === undefined) {\n return;\n }\n\n const wrappedFunc = function () {\n return testProxyZone.run(testBody, null, arguments);\n };\n try {\n Object.defineProperty(wrappedFunc, 'length', {\n configurable: true,\n writable: true,\n enumerable: false,\n });\n wrappedFunc.length = testBody.length;\n } catch (e) {\n return testBody.length === 0\n ? () => testProxyZone.run(testBody, null)\n : (done: any) => testProxyZone.run(testBody, null, [done]);\n }\n\n return wrappedFunc;\n };\n\n /**\n * bind describe method to wrap describe.each function\n */\n const bindDescribe = (\n self: any,\n originalVitestFn: {\n apply: (\n arg0: any,\n arg1: any[],\n ) => {\n (): any;\n new (): any;\n apply: { (arg0: any, arg1: any[]): any; new (): any };\n };\n },\n ) =>\n function (...eachArgs: any) {\n return function (...args: any[]) {\n args[1] = wrapDescribeInZone(args[1]);\n\n // @ts-ignore\n return originalVitestFn.apply(self, eachArgs).apply(self, args);\n };\n };\n\n /**\n * bind test method to wrap test.each function\n */\n const bindTest = (\n self: any,\n originalVitestFn: {\n apply: (\n arg0: any,\n arg1: any[],\n ) => {\n (): any;\n new (): any;\n apply: { (arg0: any, arg1: any[]): any; new (): any };\n };\n },\n ) =>\n function (...eachArgs: any) {\n return function (...args: any[]) {\n args[1] = wrapTestInZone(args[1]);\n\n // @ts-ignore\n return originalVitestFn.apply(self, eachArgs).apply(self, args);\n };\n };\n\n ['describe'].forEach((methodName) => {\n const originalvitestFn = env[methodName];\n env[methodName] = function (...args: any[]) {\n args[1] = wrapDescribeInZone(args[1]);\n\n return originalvitestFn.apply(this, args);\n };\n env[methodName].each = bindDescribe(\n originalvitestFn,\n originalvitestFn.each,\n );\n if (methodName === 'describe') {\n env[methodName].only = bindDescribe(\n originalvitestFn,\n originalvitestFn.only,\n );\n env[methodName].skip = bindDescribe(\n originalvitestFn,\n originalvitestFn.skip,\n );\n }\n });\n\n ['test', 'it'].forEach((methodName) => {\n const originalvitestFn = env[methodName];\n env[methodName] = function (...args: any[]) {\n args[1] = wrapTestInZone(args[1]);\n\n return originalvitestFn.apply(this, args);\n };\n env[methodName].each = bindTest(originalvitestFn, originalvitestFn.each);\n env[methodName].only = bindTest(originalvitestFn, originalvitestFn.only);\n env[methodName].skip = bindTest(originalvitestFn, originalvitestFn.skip);\n\n if (methodName === 'test' || methodName === 'it') {\n env[methodName].todo = function (...args: any) {\n return originalvitestFn.todo.apply(this, args);\n };\n }\n });\n\n ['beforeEach', 'afterEach', 'beforeAll', 'afterAll'].forEach((methodName) => {\n const originalvitestFn = env[methodName];\n\n env[methodName] = function (...args: any[]) {\n args[0] = wrapTestInZone(args[0]);\n\n return originalvitestFn.apply(this, args);\n };\n });\n}\n"],"mappings":";;;;;;;;;;AAWA,IAAM,OAAQ,WAAmB;AAEjC,IAAI,SAAS,KAAA,EACX,OAAM,IAAI,MAAM,0BAA0B;AAM5C,IAAK,WAAmB,6BAA6B,MAAM;AACxD,YAAmB,2BAA2B;CAC/C,MAAM,mBAAmB,KAAK;CAC9B,MAAM,gBAAgB,KAAK;AAE3B,KAAI,qBAAqB,KAAA,EACvB,OAAM,IAAI,MAAM,wDAAwD;AAE1E,KAAI,kBAAkB,KAAA,EACpB,OAAM,IAAI,MAAM,oDAAoD;CAGtE,MAAM,MAAM;CACZ,MAAM,cAAc,KAAK;CAKzB,MAAM,WAAW,YAAY,KAAK,IAAI,iBAAiB,kBAAkB,CAAC;CAC1E,MAAM,qBAAqB,SAAU,cAAmB;AACtD,SAAO,SAAU,GAAG,MAAW;AAC7B,UAAO,SAAS,IAAI,cAAc,MAAM,KAAK;;;CAMjD,MAAM,gBAAgB,YAAY,KAAK,IAAI,eAAe,CAAC;CAC3D,MAAM,iBAAiB,SAAU,UAAsC;AACrE,MAAI,aAAa,KAAA,EACf;EAGF,MAAM,cAAc,WAAY;AAC9B,UAAO,cAAc,IAAI,UAAU,MAAM,UAAU;;AAErD,MAAI;AACF,UAAO,eAAe,aAAa,UAAU;IAC3C,cAAc;IACd,UAAU;IACV,YAAY;IACb,CAAC;AACF,eAAY,SAAS,SAAS;WACvB,GAAG;AACV,UAAO,SAAS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AAI,YAAY,OAAO,SAAU,GAAG,MAAW;AAC7C,UAAO,iBAAiB,KAAK,MAAM,MAAM,KAAK;;GAGlD;AAEF;EAAC;EAAc;EAAa;EAAa;EAAW,CAAC,SAAS,eAAe;EAC3E,MAAM,mBAAmB,IAAI;AAE7B,MAAI,cAAc,SAAU,GAAG,MAAa;AAC1C,QAAK,KAAK,eAAe,KAAK,GAAG;AAEjC,UAAO,iBAAiB,MAAM,MAAM,KAAK;;GAE3C"}
@@ -1,4 +1,4 @@
1
- export declare const ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.64";
1
+ export declare const ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.65";
2
2
  export declare const JSDOM = "^22.0.0";
3
3
  export declare const VITE_TSCONFIG_PATHS = "^4.2.0";
4
4
  export declare const VITE = "^7.0.0";
@@ -1,5 +1,5 @@
1
1
  //#region packages/vitest-angular-tools/src/schematics/utils/versions.ts
2
- var ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.64";
2
+ var ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.65";
3
3
  var JSDOM = "^22.0.0";
4
4
  var VITE_TSCONFIG_PATHS = "^4.2.0";
5
5
  var VITE = "^7.0.0";
@@ -1 +1 @@
1
- {"version":3,"file":"versions.js","names":[],"sources":["../../../../../../../vitest-angular-tools/src/schematics/utils/versions.ts"],"sourcesContent":["// Version constants (Angular 20+)\nexport const ANALOG_JS_VITE_PLUGIN_ANGULAR = '^3.0.0-alpha.64';\nexport const JSDOM = '^22.0.0';\nexport const VITE_TSCONFIG_PATHS = '^4.2.0';\nexport const VITE = '^7.0.0';\nexport const VITEST_V4 = '^4.0.0';\n\n// Browser mode dependencies\nexport const VITEST_BROWSER_PLAYWRIGHT = '^4.0.0';\nexport const PLAYWRIGHT = '^1.54.0';\n"],"mappings":";AACA,IAAa,gCAAgC;AAC7C,IAAa,QAAQ;AACrB,IAAa,sBAAsB;AACnC,IAAa,OAAO;AACpB,IAAa,YAAY;AAGzB,IAAa,4BAA4B;AACzC,IAAa,aAAa"}
1
+ {"version":3,"file":"versions.js","names":[],"sources":["../../../../../../../vitest-angular-tools/src/schematics/utils/versions.ts"],"sourcesContent":["// Version constants (Angular 20+)\nexport const ANALOG_JS_VITE_PLUGIN_ANGULAR = '^3.0.0-alpha.65';\nexport const JSDOM = '^22.0.0';\nexport const VITE_TSCONFIG_PATHS = '^4.2.0';\nexport const VITE = '^7.0.0';\nexport const VITEST_V4 = '^4.0.0';\n\n// Browser mode dependencies\nexport const VITEST_BROWSER_PLAYWRIGHT = '^4.0.0';\nexport const PLAYWRIGHT = '^1.54.0';\n"],"mappings":";AACA,IAAa,gCAAgC;AAC7C,IAAa,QAAQ;AACrB,IAAa,sBAAsB;AACnC,IAAa,OAAO;AACpB,IAAa,YAAY;AAGzB,IAAa,4BAA4B;AACzC,IAAa,aAAa"}
@@ -1,4 +1,4 @@
1
- export declare const ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.64";
1
+ export declare const ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.65";
2
2
  export declare const JSDOM = "^22.0.0";
3
3
  export declare const VITE_TSCONFIG_PATHS = "^4.2.0";
4
4
  export declare const VITE = "^7.0.0";