@analogjs/vitest-angular 3.0.0-alpha.26 → 3.0.0-alpha.27
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/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.124.0}/helpers/decorate.js +1 -1
- package/package.json +1 -1
- package/setup-testbed.js +1 -1
- package/setup-zone.d.ts +0 -1
- package/setup-zone.js +3 -1
- package/setup-zone.js.map +1 -1
- package/src/lib/tools/schematics/setup/files/vite.config.mts.template +2 -7
- package/src/lib/tools/schematics/utils/versions.d.ts +1 -1
- package/src/lib/tools/schematics/utils/versions.js +1 -1
- package/src/lib/tools/schematics/utils/versions.js.map +1 -1
- package/src/lib/tools/src/schematics/utils/versions.d.ts +1 -1
package/_virtual/{_@oxc-project_runtime@0.122.0 → _@oxc-project_runtime@0.124.0}/helpers/decorate.js
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.124.0/helpers/decorate.js
|
|
2
2
|
function __decorate(decorators, target, key, desc) {
|
|
3
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
package/package.json
CHANGED
package/setup-testbed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from "./_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import { __decorate } from "./_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
|
|
2
2
|
import { NgModule, provideZonelessChangeDetection } from "@angular/core";
|
|
3
3
|
import { getTestBed, ɵgetCleanupHook } from "@angular/core/testing";
|
|
4
4
|
import { BrowserTestingModule, platformBrowserTesting } from "@angular/platform-browser/testing";
|
package/setup-zone.d.ts
CHANGED
package/setup-zone.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import { createAngularFixtureSnapshotSerializer } from "./src/lib/snapshot-serializers/angular-fixture.js";
|
|
2
2
|
import "zone.js";
|
|
3
3
|
import "zone.js/plugins/sync-test";
|
|
4
4
|
import "zone.js/plugins/proxy";
|
|
@@ -18,6 +18,8 @@ if (SyncTestZoneSpec === void 0) throw new Error("Missing: SyncTestZoneSpec (zon
|
|
|
18
18
|
if (ProxyZoneSpec === void 0) throw new Error("Missing: ProxyZoneSpec (zone.js/plugins/proxy.js)");
|
|
19
19
|
var env = globalThis;
|
|
20
20
|
var ambientZone = Zone.current;
|
|
21
|
+
var originalExpect = env["expect"];
|
|
22
|
+
if (originalExpect) originalExpect.addSnapshotSerializer(createAngularFixtureSnapshotSerializer());
|
|
21
23
|
var syncZone = ambientZone.fork(new SyncTestZoneSpec("vitest.describe"));
|
|
22
24
|
function wrapDescribeInZone(describeBody) {
|
|
23
25
|
return function(...args) {
|
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 './
|
|
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,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
5
|
-
<% if (isNx) { %>import
|
|
6
|
-
<% } else { %>import viteTsConfigPaths from 'vite-tsconfig-paths';<% } %>
|
|
5
|
+
<% if (!isNx) { %>import viteTsConfigPaths from 'vite-tsconfig-paths';<% } %>
|
|
7
6
|
<% if (browserMode) { %>import { playwright } from '@vitest/browser-playwright';<% } %>
|
|
8
7
|
|
|
9
8
|
// https://vitejs.dev/config/
|
|
10
9
|
export default defineConfig(({ mode }) => ({
|
|
11
|
-
<% if (isNx) { %>
|
|
12
|
-
plugins: [angular(), nxViteTsPaths()],
|
|
13
|
-
<% } else { %>
|
|
14
|
-
plugins: [angular(), viteTsConfigPaths()],
|
|
15
|
-
<% } %>
|
|
10
|
+
plugins: [angular()<% if (!isNx) { %>, viteTsConfigPaths()<% } %>],
|
|
16
11
|
test: {
|
|
17
12
|
globals: true,
|
|
18
13
|
<% if (browserMode) { %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.
|
|
1
|
+
export declare const ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.27";
|
|
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.
|
|
2
|
+
var ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.27";
|
|
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.
|
|
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.27';\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.
|
|
1
|
+
export declare const ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.27";
|
|
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";
|