vitest-auto-spy 5.65.0 → 5.66.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/AGENTS.md +3 -0
- package/CHANGELOG.md +16 -1
- package/README.md +21 -0
- package/agent-docs/adapters.md +9 -0
- package/dist/angular-diagnostics.js +9 -9
- package/dist/angular-doubles.js +14 -14
- package/dist/angular-http.js +4 -4
- package/dist/angular-matchers.js +1 -1
- package/dist/angular-router.js +6 -6
- package/dist/bun-angular.js +19 -19
- package/dist/bun.js +11 -11
- package/dist/{chunk-P6P7UE7C.js → chunk-2CWSOIBW.js} +1 -1
- package/dist/{chunk-LZ64J6OW.js → chunk-5GKIQX65.js} +3 -3
- package/dist/{chunk-C4OFWAK7.js → chunk-7GOVSGXB.js} +2 -2
- package/dist/{chunk-7A4QSHDK.js → chunk-7WU53KRS.js} +3 -1
- package/dist/{chunk-VFPT6JP6.js → chunk-A2X7O5EP.js} +2 -2
- package/dist/{chunk-PHXYSUVL.js → chunk-DCCURN7I.js} +1 -1
- package/dist/{chunk-SSTOOTI2.js → chunk-DWMIQ7VO.js} +1 -1
- package/dist/{chunk-JOLWHOGU.js → chunk-EZKDQ4WO.js} +1 -1
- package/dist/{chunk-Y3MYFJ75.js → chunk-EZTP5VUF.js} +4 -4
- package/dist/{chunk-UON4XYJW.js → chunk-HIGHZ4BW.js} +2 -2
- package/dist/{chunk-VEYLI6J2.js → chunk-IXARK3B6.js} +2 -2
- package/dist/{chunk-VJV6QF4Z.js → chunk-KCQOZSNA.js} +6 -6
- package/dist/{chunk-5XYULG5M.js → chunk-NMXLXBXH.js} +2 -2
- package/dist/{chunk-LGWVFIIJ.js → chunk-OIHOH2RY.js} +1 -1
- package/dist/{chunk-TH2H3MSZ.js → chunk-OXE6FCQX.js} +4 -4
- package/dist/{chunk-FWXGEM2E.js → chunk-PS6UQC4C.js} +1 -1
- package/dist/{chunk-NGVSSYI4.js → chunk-QATP6Q3G.js} +1 -1
- package/dist/{chunk-IR5AZKBS.js → chunk-TRRI7TXE.js} +1 -1
- package/dist/{chunk-2OYBXIQC.js → chunk-XLKBJSYQ.js} +3 -3
- package/dist/{chunk-BRKMJMTO.js → chunk-XZS56XV5.js} +1 -1
- package/dist/cli.js +8 -1
- package/dist/console.js +8 -8
- package/dist/jasmine-compat.js +2 -2
- package/dist/jasmine.js +12 -12
- package/dist/nestjs.d.ts +65 -1
- package/dist/nestjs.js +93 -12
- package/dist/rstest.js +10 -10
- package/dist/rxjs.js +2 -2
- package/dist/signal-forms.js +1 -1
- package/dist/zone.js +1 -1
- package/package.json +1 -1
- package/skills/vitest-auto-spy/SKILL.md +3 -1
package/AGENTS.md
CHANGED
|
@@ -536,6 +536,9 @@ file, and `globals: true`.
|
|
|
536
536
|
|
|
537
537
|
In [`agent-docs/adapters.md`](./agent-docs/adapters.md). Read it for NestJS, Vue, React, Svelte, `bun test`, `node:test`, Rstest and the console entry.
|
|
538
538
|
|
|
539
|
+
Nest HTTP tests: `createHttpExecutionContext` supplies the context; `invokeNestParamDecorator`
|
|
540
|
+
calls a custom parameter factory by index with its recorded data. Both come from `/nestjs` (§15).
|
|
541
|
+
|
|
539
542
|
<!-- agents-outline: agent-docs/adapters.md -->
|
|
540
543
|
|
|
541
544
|
- `trackNodeMocks` for `node:test` memory
|
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,20 @@ The latest released version here must always match the one published on
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [5.66.0] - 2026-10-28
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- `/nestjs`: `createHttpExecutionContext` supplies an HTTP context for guards, interceptors,
|
|
18
|
+
exception filters and parameter decorators. Request, response and argument accessors share the
|
|
19
|
+
same values; missing handler/class metadata and non-HTTP transports produce explicit errors.
|
|
20
|
+
- `/nestjs`: `invokeNestParamDecorator` runs a custom parameter decorator's recorded factory by
|
|
21
|
+
parameter index and forwards its stored data. It refuses missing or ambiguous factories and
|
|
22
|
+
parameter pipes or schemas that need Nest's request pipeline.
|
|
23
|
+
- **Bundle size:** `/nestjs` grows from 20.06 kB to 20.85 kB min+gzip (+0.79 kB, +3.9%) for
|
|
24
|
+
the HTTP context and parameter metadata helpers, without importing NestJS or Vitest. The root
|
|
25
|
+
entry does not re-export these helpers.
|
|
26
|
+
|
|
13
27
|
## [5.65.0] - 2026-10-26
|
|
14
28
|
|
|
15
29
|
## [5.64.0] - 2026-10-23
|
|
@@ -6888,7 +6902,8 @@ moved under 1 %: `/angular` +192 B (+1.0 %) for the override queue and the HTTP
|
|
|
6888
6902
|
This copy ships with the package and carries 5.x only. Releases before 5.0.0 are in the
|
|
6889
6903
|
[full changelog](https://github.com/ASDAlexey/vitest-auto-spy/blob/master/CHANGELOG.md).
|
|
6890
6904
|
|
|
6891
|
-
[Unreleased]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.
|
|
6905
|
+
[Unreleased]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.66.0...HEAD
|
|
6906
|
+
[5.66.0]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.65.0...v5.66.0
|
|
6892
6907
|
[5.65.0]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.64.0...v5.65.0
|
|
6893
6908
|
[5.64.0]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.63.0...v5.64.0
|
|
6894
6909
|
[5.63.0]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.62.0...v5.63.0
|
package/README.md
CHANGED
|
@@ -47,6 +47,8 @@ replacement for [`jest-auto-spies`](https://www.npmjs.com/package/jest-auto-spie
|
|
|
47
47
|
- **A spy from a type alone**: `createAutoMock<T>()` and `mockDeep<T>()`.
|
|
48
48
|
- **Angular `TestBed` in one line**: `provideAutoSpy(ApiService)`, then `injectSpy(ApiService)`.
|
|
49
49
|
- **Short handler tests**: typed input/paste/drop events, element query stubs, and exact synchronous output assertions.
|
|
50
|
+
- **Nest HTTP tests without starting the app**: `createHttpExecutionContext` supplies the context;
|
|
51
|
+
`invokeNestParamDecorator` runs a custom parameter decorator with its recorded data.
|
|
50
52
|
- **One API on every runner**: Vitest, Bun, `node:test` and Rstest; helpers for Angular, NestJS,
|
|
51
53
|
React, Vue / Pinia and Svelte.
|
|
52
54
|
- **Checks that make silent tests fail**: strict mode, Observable assertions, cleanup between tests,
|
|
@@ -2933,6 +2935,25 @@ Pass `{ expose: [Dependency] }` to keep a collaborator real, and `providers` to
|
|
|
2933
2935
|
`vitest`. On `node --test`, Bun or Rstest, import the runtime entry first. `createNestUnit` is also
|
|
2934
2936
|
exported from `vitest-auto-spy/node` and `vitest-auto-spy/bun`.
|
|
2935
2937
|
|
|
2938
|
+
Test a custom parameter decorator without starting Nest or reading its metadata by hand.
|
|
2939
|
+
Here `ProfileController.profile` has `@CurrentUser('id')` on its first parameter:
|
|
2940
|
+
|
|
2941
|
+
```ts
|
|
2942
|
+
import 'reflect-metadata';
|
|
2943
|
+
|
|
2944
|
+
import { expect } from 'vitest';
|
|
2945
|
+
import { createHttpExecutionContext, invokeNestParamDecorator } from 'vitest-auto-spy/nestjs';
|
|
2946
|
+
|
|
2947
|
+
import { ProfileController } from './profile.controller';
|
|
2948
|
+
|
|
2949
|
+
const context = createHttpExecutionContext({ request: { user: { id: 'user-7' } } });
|
|
2950
|
+
expect(invokeNestParamDecorator(ProfileController, 'profile', 0, context)).toBe('user-7');
|
|
2951
|
+
```
|
|
2952
|
+
|
|
2953
|
+
The parameter index starts at zero. The helper runs the recorded factory with its decorator data;
|
|
2954
|
+
pipes and schemas require Nest's validation pipeline and are refused.
|
|
2955
|
+
Use the same context helper for guards, interceptors and exception filters.
|
|
2956
|
+
|
|
2936
2957
|
Full page: [NestJS](https://asdalexey.github.io/vitest-auto-spy/adapters/nestjs).
|
|
2937
2958
|
|
|
2938
2959
|
#### `httpResource()` and `HttpClient` — `vitest-auto-spy/angular-http`
|
package/agent-docs/adapters.md
CHANGED
|
@@ -28,6 +28,15 @@ mount(Greeting, { global: { provide } });
|
|
|
28
28
|
import { createSpyFromClass } from 'vitest-auto-spy/react';
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
**Nest HTTP tests.** `createHttpExecutionContext({ request, response, handler, class: Controller })`
|
|
32
|
+
from `/nestjs` supplies an HTTP `ExecutionContext` / `ArgumentsHost` without starting Nest. Omit
|
|
33
|
+
the options you do not need; `getClass()` / `getHandler()` throw if their option is missing.
|
|
34
|
+
`invokeNestParamDecorator(Controller, 'method', parameterIndex, context)` runs a custom parameter
|
|
35
|
+
factory by zero-based index and forwards its recorded `data`. Import `reflect-metadata` before
|
|
36
|
+
the controller. The result is `unknown`; async factories return their promise unchanged. Native
|
|
37
|
+
parameter decorators, pipes and schemas require Nest's pipeline and are refused. Examples:
|
|
38
|
+
[Nest HTTP helpers](https://asdalexey.github.io/vitest-auto-spy/adapters/nestjs#createhttpexecutioncontext).
|
|
39
|
+
|
|
31
40
|
**Types without Vitest.** `/node`, `/bun`, `/bun-angular`, `/rstest`, `/jasmine-compat`,
|
|
32
41
|
`/angular-router`, `/console`, `/nestjs`, `/observer-spy` and `/rxjs` type-check with no Vitest
|
|
33
42
|
installed and `skipLibCheck: false`. `Spy<T>` is one type on every entry: once the program imports an
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { pendingRequestsReport, instrumentTestBed, onTestingModuleConfigured, onComponentCreated, HTTP_TESTING_BRAND, beforeTestBedReset, verifyOnTeardown } from './chunk-C7K75NLS.js';
|
|
2
2
|
export { disableTestBedDiagnostics, enableTestBedDiagnostics, formatSpecTiming, getTestBedTiming, instrumentTestBed, reportSpecTiming } from './chunk-C7K75NLS.js';
|
|
3
|
-
import { assertAngularInternals } from './chunk-
|
|
4
|
-
import { failOnUnspiedProvider, onTestBedFileEnd, isLazyDoubleFactory } from './chunk-
|
|
3
|
+
import { assertAngularInternals } from './chunk-OIHOH2RY.js';
|
|
4
|
+
import { failOnUnspiedProvider, onTestBedFileEnd, isLazyDoubleFactory } from './chunk-OXE6FCQX.js';
|
|
5
5
|
import './chunk-T5MQSNRX.js';
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
9
|
-
import './chunk-
|
|
6
|
+
import './chunk-XZS56XV5.js';
|
|
7
|
+
import './chunk-5GKIQX65.js';
|
|
8
|
+
import './chunk-XLKBJSYQ.js';
|
|
9
|
+
import './chunk-QATP6Q3G.js';
|
|
10
10
|
import './chunk-PC3FAZT3.js';
|
|
11
|
-
import './chunk-
|
|
12
|
-
import { isAutoSpyLike } from './chunk-
|
|
11
|
+
import './chunk-HIGHZ4BW.js';
|
|
12
|
+
import { isAutoSpyLike } from './chunk-2CWSOIBW.js';
|
|
13
13
|
import { count, sourceClassName, taskName } from './chunk-DYAS4OK4.js';
|
|
14
|
-
import { angularPendingRequests, angularShadowedProviders, angularDeadSchemas, angularNgModuleScopesAuto } from './chunk-
|
|
14
|
+
import { angularPendingRequests, angularShadowedProviders, angularDeadSchemas, angularNgModuleScopesAuto } from './chunk-7WU53KRS.js';
|
|
15
15
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
16
16
|
import { getTestBed } from '@angular/core/testing';
|
|
17
17
|
import { beforeEach, afterEach } from 'vitest';
|
package/dist/angular-doubles.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { useVitestAdapter } from './chunk-
|
|
2
|
-
import { assertAngularInternals } from './chunk-
|
|
3
|
-
import { describeInstance } from './chunk-
|
|
1
|
+
import { useVitestAdapter } from './chunk-IXARK3B6.js';
|
|
2
|
+
import { assertAngularInternals } from './chunk-OIHOH2RY.js';
|
|
3
|
+
import { describeInstance } from './chunk-PS6UQC4C.js';
|
|
4
4
|
import { signalSymbol, readSignalSymbol } from './chunk-T5MQSNRX.js';
|
|
5
|
-
import { angularInternalsError } from './chunk-
|
|
6
|
-
import { mockReadonlyProp } from './chunk-
|
|
7
|
-
import { createSpyFromClass } from './chunk-
|
|
8
|
-
import './chunk-
|
|
9
|
-
import './chunk-
|
|
5
|
+
import { angularInternalsError } from './chunk-XZS56XV5.js';
|
|
6
|
+
import { mockReadonlyProp } from './chunk-5GKIQX65.js';
|
|
7
|
+
import { createSpyFromClass } from './chunk-XLKBJSYQ.js';
|
|
8
|
+
import './chunk-NMXLXBXH.js';
|
|
9
|
+
import './chunk-EZTP5VUF.js';
|
|
10
10
|
import './chunk-YHDBRBGU.js';
|
|
11
|
-
import './chunk-
|
|
12
|
-
import './chunk-
|
|
11
|
+
import './chunk-EZKDQ4WO.js';
|
|
12
|
+
import './chunk-QATP6Q3G.js';
|
|
13
13
|
import './chunk-PC3FAZT3.js';
|
|
14
|
-
import './chunk-
|
|
15
|
-
import { createFunctionSpy } from './chunk-
|
|
16
|
-
import './chunk-
|
|
14
|
+
import './chunk-DWMIQ7VO.js';
|
|
15
|
+
import { createFunctionSpy } from './chunk-HIGHZ4BW.js';
|
|
16
|
+
import './chunk-2CWSOIBW.js';
|
|
17
17
|
import { sourceClassName } from './chunk-DYAS4OK4.js';
|
|
18
|
-
import { angularDialog, angularSignalProp } from './chunk-
|
|
18
|
+
import { angularDialog, angularSignalProp } from './chunk-7WU53KRS.js';
|
|
19
19
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
20
20
|
import { TestBed } from '@angular/core/testing';
|
|
21
21
|
import { ReplaySubject, Subject } from 'rxjs';
|
package/dist/angular-http.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { HTTP_TESTING_BRAND, pendingRequestsReport, verifyOnTeardown, beforeTestBedReset } from './chunk-C7K75NLS.js';
|
|
2
|
-
import { assertAngularInternals } from './chunk-
|
|
3
|
-
import { flushEffects } from './chunk-
|
|
2
|
+
import { assertAngularInternals } from './chunk-OIHOH2RY.js';
|
|
3
|
+
import { flushEffects } from './chunk-DCCURN7I.js';
|
|
4
4
|
import './chunk-T5MQSNRX.js';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-XZS56XV5.js';
|
|
6
6
|
import './chunk-SF4GKKN4.js';
|
|
7
7
|
import './chunk-SOROJD3W.js';
|
|
8
8
|
import { count, taskName } from './chunk-DYAS4OK4.js';
|
|
9
|
-
import { angularHttpNoRequest, angularHttpPending, angularHttpController, angularHttpExpectRequest } from './chunk-
|
|
9
|
+
import { angularHttpNoRequest, angularHttpPending, angularHttpController, angularHttpExpectRequest } from './chunk-7WU53KRS.js';
|
|
10
10
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
11
11
|
import { DOCUMENT } from '@angular/common';
|
|
12
12
|
import { withInterceptors, provideHttpClient } from '@angular/common/http';
|
package/dist/angular-matchers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { strictEquals, looseEquals } from './chunk-B6JUBFBA.js';
|
|
2
2
|
import { signalSymbol } from './chunk-T5MQSNRX.js';
|
|
3
3
|
import { sourceClassName, count } from './chunk-DYAS4OK4.js';
|
|
4
|
-
import { angularDirectiveApplied } from './chunk-
|
|
4
|
+
import { angularDirectiveApplied } from './chunk-7WU53KRS.js';
|
|
5
5
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
6
6
|
import '@angular/compiler';
|
|
7
7
|
import { isStandalone, DebugElement, reflectComponentType } from '@angular/core';
|
package/dist/angular-router.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { describeInstance } from './chunk-
|
|
2
|
-
import { angularInternalsError } from './chunk-
|
|
3
|
-
import { getTestFinishedHook } from './chunk-
|
|
4
|
-
import { createFunctionSpy } from './chunk-
|
|
5
|
-
import './chunk-
|
|
1
|
+
import { describeInstance } from './chunk-PS6UQC4C.js';
|
|
2
|
+
import { angularInternalsError } from './chunk-XZS56XV5.js';
|
|
3
|
+
import { getTestFinishedHook } from './chunk-DWMIQ7VO.js';
|
|
4
|
+
import { createFunctionSpy } from './chunk-HIGHZ4BW.js';
|
|
5
|
+
import './chunk-2CWSOIBW.js';
|
|
6
6
|
import { count } from './chunk-DYAS4OK4.js';
|
|
7
|
-
import { angularRouteDouble, angularRouterInject, angularRouterEvents, angularLocationDouble, angularRouteWiring, angularRouterDouble } from './chunk-
|
|
7
|
+
import { angularRouteDouble, angularRouterInject, angularRouterEvents, angularLocationDouble, angularRouteWiring, angularRouterDouble } from './chunk-7WU53KRS.js';
|
|
8
8
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
9
9
|
import { TestBed } from '@angular/core/testing';
|
|
10
10
|
import { Router, DefaultUrlSerializer, PRIMARY_OUTLET, RouterState, ActivatedRoute, NavigationEnd, RouterStateSnapshot, ActivatedRouteSnapshot, NavigationStart, NavigationCancel, NavigationError, NavigationSkipped, UrlSegment, VERSION, createUrlTreeFromSnapshot } from '@angular/router';
|
package/dist/bun-angular.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { withTestBedSplitExplained } from './chunk-
|
|
2
|
-
export { injectSpy, provideAutoSpy } from './chunk-
|
|
3
|
-
import { stable, flushEffects } from './chunk-
|
|
4
|
-
export { flushEffects, stable } from './chunk-
|
|
1
|
+
import { withTestBedSplitExplained } from './chunk-OXE6FCQX.js';
|
|
2
|
+
export { injectSpy, provideAutoSpy } from './chunk-OXE6FCQX.js';
|
|
3
|
+
import { stable, flushEffects } from './chunk-DCCURN7I.js';
|
|
4
|
+
export { flushEffects, stable } from './chunk-DCCURN7I.js';
|
|
5
5
|
import { readSignalSymbol } from './chunk-T5MQSNRX.js';
|
|
6
|
-
import { angularInternalsError } from './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
import { createSpyForToken } from './chunk-
|
|
9
|
-
export { createNestUnit } from './chunk-
|
|
10
|
-
export { adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, createDeferred, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromInstance, describeDuplicateCopies, expectAllEmissions, expectCompletion, expectEmission, expectEmissionSync, expectEmissions, expectEmissionsSync, expectError, expectNoEmission, expectNoEmissionSync, flushEventLoop, flushEventLoopUntil, getPackageCopies, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, restoreSpiedInstance, setEmissionTimeout, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './chunk-
|
|
11
|
-
import { mockValueProp } from './chunk-
|
|
12
|
-
export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, reportPropsOutsideHooks, restoreMockedProps } from './chunk-
|
|
13
|
-
import { closestName } from './chunk-
|
|
14
|
-
export { autoMocked, clearAutoSpy, clearAutoSpyDefaults, createAutoMock, createSpyFromClass, innerDouble, registerAutoSpyDefaults, resetAutoSpy } from './chunk-
|
|
6
|
+
import { angularInternalsError } from './chunk-XZS56XV5.js';
|
|
7
|
+
import './chunk-A2X7O5EP.js';
|
|
8
|
+
import { createSpyForToken } from './chunk-7GOVSGXB.js';
|
|
9
|
+
export { createNestUnit } from './chunk-7GOVSGXB.js';
|
|
10
|
+
export { adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, createDeferred, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromInstance, describeDuplicateCopies, expectAllEmissions, expectCompletion, expectEmission, expectEmissionSync, expectEmissions, expectEmissionsSync, expectError, expectNoEmission, expectNoEmissionSync, flushEventLoop, flushEventLoopUntil, getPackageCopies, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, restoreSpiedInstance, setEmissionTimeout, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './chunk-KCQOZSNA.js';
|
|
11
|
+
import { mockValueProp } from './chunk-5GKIQX65.js';
|
|
12
|
+
export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, reportPropsOutsideHooks, restoreMockedProps } from './chunk-5GKIQX65.js';
|
|
13
|
+
import { closestName } from './chunk-XLKBJSYQ.js';
|
|
14
|
+
export { autoMocked, clearAutoSpy, clearAutoSpyDefaults, createAutoMock, createSpyFromClass, innerDouble, registerAutoSpyDefaults, resetAutoSpy } from './chunk-XLKBJSYQ.js';
|
|
15
15
|
import { fakeClockBacklog } from './chunk-SF4GKKN4.js';
|
|
16
16
|
import './chunk-SOROJD3W.js';
|
|
17
|
-
import './chunk-
|
|
18
|
-
import './chunk-
|
|
17
|
+
import './chunk-EZKDQ4WO.js';
|
|
18
|
+
import './chunk-QATP6Q3G.js';
|
|
19
19
|
import './chunk-PC3FAZT3.js';
|
|
20
|
-
import './chunk-
|
|
21
|
-
export { createFunctionSpy, errorHandler } from './chunk-
|
|
22
|
-
import { libraryWarn } from './chunk-
|
|
20
|
+
import './chunk-DWMIQ7VO.js';
|
|
21
|
+
export { createFunctionSpy, errorHandler } from './chunk-HIGHZ4BW.js';
|
|
22
|
+
import { libraryWarn } from './chunk-2CWSOIBW.js';
|
|
23
23
|
import { displayPath, sourceClassName, count } from './chunk-DYAS4OK4.js';
|
|
24
|
-
import { angularEffects, angularTrackRuns, bunAngular, angularUnreadResource, angularCreateWithAutoSpies, angularResources, angularTypedElements, angularOverrideLate, angularInputs, angularKeepTemplate } from './chunk-
|
|
24
|
+
import { angularEffects, angularTrackRuns, bunAngular, angularUnreadResource, angularCreateWithAutoSpies, angularResources, angularTypedElements, angularOverrideLate, angularInputs, angularKeepTemplate } from './chunk-7WU53KRS.js';
|
|
25
25
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
26
26
|
import '@angular/compiler';
|
|
27
27
|
import { NgModule, provideZonelessChangeDetection, Injector, runInInjectionContext, untracked, NO_ERRORS_SCHEMA } from '@angular/core';
|
package/dist/bun.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import './chunk-
|
|
2
|
-
export { createNestUnit } from './chunk-
|
|
3
|
-
export { adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, createDeferred, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromInstance, describeDuplicateCopies, expectAllEmissions, expectCompletion, expectEmission, expectEmissionSync, expectEmissions, expectEmissionsSync, expectError, expectNoEmission, expectNoEmissionSync, flushEventLoop, flushEventLoopUntil, getPackageCopies, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, restoreSpiedInstance, setEmissionTimeout, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './chunk-
|
|
4
|
-
export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, reportPropsOutsideHooks, restoreMockedProps } from './chunk-
|
|
5
|
-
export { autoMocked, clearAutoSpy, clearAutoSpyDefaults, createAutoMock, createSpyFromClass, innerDouble, registerAutoSpyDefaults, resetAutoSpy } from './chunk-
|
|
1
|
+
import './chunk-A2X7O5EP.js';
|
|
2
|
+
export { createNestUnit } from './chunk-7GOVSGXB.js';
|
|
3
|
+
export { adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, createDeferred, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromInstance, describeDuplicateCopies, expectAllEmissions, expectCompletion, expectEmission, expectEmissionSync, expectEmissions, expectEmissionsSync, expectError, expectNoEmission, expectNoEmissionSync, flushEventLoop, flushEventLoopUntil, getPackageCopies, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, restoreSpiedInstance, setEmissionTimeout, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './chunk-KCQOZSNA.js';
|
|
4
|
+
export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, reportPropsOutsideHooks, restoreMockedProps } from './chunk-5GKIQX65.js';
|
|
5
|
+
export { autoMocked, clearAutoSpy, clearAutoSpyDefaults, createAutoMock, createSpyFromClass, innerDouble, registerAutoSpyDefaults, resetAutoSpy } from './chunk-XLKBJSYQ.js';
|
|
6
6
|
import './chunk-SF4GKKN4.js';
|
|
7
7
|
import './chunk-SOROJD3W.js';
|
|
8
|
-
import './chunk-
|
|
9
|
-
import './chunk-
|
|
8
|
+
import './chunk-EZKDQ4WO.js';
|
|
9
|
+
import './chunk-QATP6Q3G.js';
|
|
10
10
|
import './chunk-PC3FAZT3.js';
|
|
11
|
-
import './chunk-
|
|
12
|
-
export { createFunctionSpy, errorHandler } from './chunk-
|
|
13
|
-
import './chunk-
|
|
11
|
+
import './chunk-DWMIQ7VO.js';
|
|
12
|
+
export { createFunctionSpy, errorHandler } from './chunk-HIGHZ4BW.js';
|
|
13
|
+
import './chunk-2CWSOIBW.js';
|
|
14
14
|
import './chunk-DYAS4OK4.js';
|
|
15
|
-
import './chunk-
|
|
15
|
+
import './chunk-7WU53KRS.js';
|
|
16
16
|
import './chunk-ENCEEH23.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isCannotRedefine, redefineFailure } from './chunk-
|
|
2
|
-
import { libraryWarn } from './chunk-
|
|
1
|
+
import { isCannotRedefine, redefineFailure } from './chunk-QATP6Q3G.js';
|
|
2
|
+
import { libraryWarn } from './chunk-2CWSOIBW.js';
|
|
3
3
|
import { count, displayPath } from './chunk-DYAS4OK4.js';
|
|
4
|
-
import { setupGlobals, setupWrongHook, setup } from './chunk-
|
|
4
|
+
import { setupGlobals, setupWrongHook, setup } from './chunk-7WU53KRS.js';
|
|
5
5
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
6
6
|
import { getMockAdapter } from './shared-state.js';
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createSpyFromClass, createAutoMock } from './chunk-
|
|
1
|
+
import { createSpyFromClass, createAutoMock } from './chunk-XLKBJSYQ.js';
|
|
2
2
|
import { sourceClassName } from './chunk-DYAS4OK4.js';
|
|
3
|
-
import { trackInjectionsUntracked, nestUnitRefusals } from './chunk-
|
|
3
|
+
import { trackInjectionsUntracked, nestUnitRefusals } from './chunk-7WU53KRS.js';
|
|
4
4
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
5
5
|
|
|
6
6
|
// src/lib/track-injections.ts
|
|
@@ -58,6 +58,8 @@ var moduleMocksAssert = "https://asdalexey.github.io/vitest-auto-spy/utilities/m
|
|
|
58
58
|
var moduleMocksNoOp = "https://asdalexey.github.io/vitest-auto-spy/utilities/module-mocks#the-two-ways-vi-mock-becomes-a-no-op";
|
|
59
59
|
var narrow = "https://asdalexey.github.io/vitest-auto-spy/utilities/fixtures#narrow-value-predicate-\u2014-the-branch-a-test-knows-it-got";
|
|
60
60
|
var nestUnitRefusals = "https://asdalexey.github.io/vitest-auto-spy/adapters/nestjs#what-it-refuses-and-what-the-message-says";
|
|
61
|
+
var nestHttpContext = "https://asdalexey.github.io/vitest-auto-spy/adapters/nestjs#createhttpexecutioncontext";
|
|
62
|
+
var nestParamDecorator = "https://asdalexey.github.io/vitest-auto-spy/adapters/nestjs#invokenestparamdecorator";
|
|
61
63
|
var observableFailures = "https://asdalexey.github.io/vitest-auto-spy/core/observable-assertions#failure-messages";
|
|
62
64
|
var realSeam = "https://asdalexey.github.io/vitest-auto-spy/utilities/module-mocks#provide-a-real-seam";
|
|
63
65
|
var nextWithValuesLate = "https://asdalexey.github.io/vitest-auto-spy/runtimes/rxjs#nextwith-pushes-nextwithvalues-republishes";
|
|
@@ -71,4 +73,4 @@ var strictModePassthrough = "https://asdalexey.github.io/vitest-auto-spy/core/st
|
|
|
71
73
|
var trackInjectionsUntracked = "https://asdalexey.github.io/vitest-auto-spy/utilities/track-injections#get-on-a-token-that-is-not-tracked";
|
|
72
74
|
var zoneRequirements = "https://asdalexey.github.io/vitest-auto-spy/utilities/zone#requirements";
|
|
73
75
|
|
|
74
|
-
export { adoptMock, angularComponentStub, angularCreateWithAutoSpies, angularDeadSchemas, angularDialog, angularDirectiveApplied, angularEffects, angularHttpController, angularHttpExpectRequest, angularHttpNoRequest, angularHttpPending, angularInjectSpyReal, angularInputs, angularInternals, angularKeepTemplate, angularLocationDouble, angularNgModuleScopesAuto, angularOverrideLate, angularPendingRequests, angularResources, angularRouteDouble, angularRouteWiring, angularRouterDouble, angularRouterEvents, angularRouterInject, angularShadowedProviders, angularSignalProp, angularStable, angularTestBedCopies, angularTrackRuns, angularTypedElements, angularUnreadResource, autoMockByType, autoMockHeldBack, bunAngular, captureArg, controlHelpers, createSpyFromClass, createSpyFromClassAccessorSpies, createSpyFromClassAccessors, createSpyFromClassInstanceMethods, createSpyFromClassLazySpies, createSpyFromClassLiveDomNode, createSpyFromClassReturns, eventLoopUntil, installationEntries, installationVitest, jasmineAutoSpies, jasmineClock, jasmineGlobals, jasmineTimeout, jasmineWithArgs, lenientCalledWithMiss, mockConstructor, moduleMocksAssert, moduleMocksNoOp, mustBeCalledWith, narrow, nestUnitRefusals, nextWithValuesLate, observableFailures, realSeam, setup, setupGlobals, setupWrongHook, signalFormsCreate, signalFormsErrors, strictCall, strictModePassthrough, trackInjectionsUntracked, zoneRequirements };
|
|
76
|
+
export { adoptMock, angularComponentStub, angularCreateWithAutoSpies, angularDeadSchemas, angularDialog, angularDirectiveApplied, angularEffects, angularHttpController, angularHttpExpectRequest, angularHttpNoRequest, angularHttpPending, angularInjectSpyReal, angularInputs, angularInternals, angularKeepTemplate, angularLocationDouble, angularNgModuleScopesAuto, angularOverrideLate, angularPendingRequests, angularResources, angularRouteDouble, angularRouteWiring, angularRouterDouble, angularRouterEvents, angularRouterInject, angularShadowedProviders, angularSignalProp, angularStable, angularTestBedCopies, angularTrackRuns, angularTypedElements, angularUnreadResource, autoMockByType, autoMockHeldBack, bunAngular, captureArg, controlHelpers, createSpyFromClass, createSpyFromClassAccessorSpies, createSpyFromClassAccessors, createSpyFromClassInstanceMethods, createSpyFromClassLazySpies, createSpyFromClassLiveDomNode, createSpyFromClassReturns, eventLoopUntil, installationEntries, installationVitest, jasmineAutoSpies, jasmineClock, jasmineGlobals, jasmineTimeout, jasmineWithArgs, lenientCalledWithMiss, mockConstructor, moduleMocksAssert, moduleMocksNoOp, mustBeCalledWith, narrow, nestHttpContext, nestParamDecorator, nestUnitRefusals, nextWithValuesLate, observableFailures, realSeam, setup, setupGlobals, setupWrongHook, signalFormsCreate, signalFormsErrors, strictCall, strictModePassthrough, trackInjectionsUntracked, zoneRequirements };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { guardAccessorSpies, createRedefineMockAdapter } from './chunk-
|
|
2
|
-
import { registerRunnerHooks } from './chunk-
|
|
1
|
+
import { guardAccessorSpies, createRedefineMockAdapter } from './chunk-EZKDQ4WO.js';
|
|
2
|
+
import { registerRunnerHooks } from './chunk-DWMIQ7VO.js';
|
|
3
3
|
import * as bunTest from 'bun:test';
|
|
4
4
|
import { registerMockAdapter } from './shared-state.js';
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fakeClockBacklog } from './chunk-SF4GKKN4.js';
|
|
2
2
|
import { unpatchedSetTimeout, unpatchedClearTimeout } from './chunk-SOROJD3W.js';
|
|
3
3
|
import { count } from './chunk-DYAS4OK4.js';
|
|
4
|
-
import { angularStable } from './chunk-
|
|
4
|
+
import { angularStable } from './chunk-7WU53KRS.js';
|
|
5
5
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
6
6
|
import { NgZone } from '@angular/core';
|
|
7
7
|
import { TestBed } from '@angular/core/testing';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { guardAccessorSpies, spyOnAccessorByRedefine } from './chunk-
|
|
1
|
+
import { guardAccessorSpies, spyOnAccessorByRedefine } from './chunk-EZKDQ4WO.js';
|
|
2
2
|
import { DISPOSE } from './chunk-PC3FAZT3.js';
|
|
3
|
-
import { isFastSpy, FAST_SPY_BRAND, isThenable } from './chunk-
|
|
4
|
-
import { setSharedHelperSink, hooksOf } from './chunk-
|
|
5
|
-
import { mockConstructor } from './chunk-
|
|
3
|
+
import { isFastSpy, FAST_SPY_BRAND, isThenable } from './chunk-HIGHZ4BW.js';
|
|
4
|
+
import { setSharedHelperSink, hooksOf } from './chunk-2CWSOIBW.js';
|
|
5
|
+
import { mockConstructor } from './chunk-7WU53KRS.js';
|
|
6
6
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
7
7
|
|
|
8
8
|
// src/lib/fast-mock-state.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AUTO_SPY_MARK, attachHelpers, markAsMock, reportMisconfiguration, detachedHelperError, decorate, libraryWarn } from './chunk-
|
|
1
|
+
import { AUTO_SPY_MARK, attachHelpers, markAsMock, reportMisconfiguration, detachedHelperError, decorate, libraryWarn } from './chunk-2CWSOIBW.js';
|
|
2
2
|
import { sourceClassName, displayPath } from './chunk-DYAS4OK4.js';
|
|
3
|
-
import { mustBeCalledWith, strictCall, createSpyFromClass, lenientCalledWithMiss } from './chunk-
|
|
3
|
+
import { mustBeCalledWith, strictCall, createSpyFromClass, lenientCalledWithMiss } from './chunk-7WU53KRS.js';
|
|
4
4
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
5
5
|
import { getMockAdapter, getObservableSupport, getJasmineSupport, requireObservableSupport } from './shared-state.js';
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createVitestMockAdapter } from './chunk-
|
|
2
|
-
import { registerRunnerHooks } from './chunk-
|
|
1
|
+
import { createVitestMockAdapter } from './chunk-NMXLXBXH.js';
|
|
2
|
+
import { registerRunnerHooks } from './chunk-DWMIQ7VO.js';
|
|
3
3
|
import { hasMockAdapter, registerMockAdapter } from './shared-state.js';
|
|
4
4
|
import { vi, afterEach, beforeEach } from 'vitest';
|
|
5
5
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { mockValueProp, mockAccessorsProp } from './chunk-
|
|
2
|
-
import { resolveConfiguration, mergeAutoSpyDefaults, resolveReadGuard, mergeMethodNames, getCallableMemberNames, createTrackedPropSpy, applyConfiguredReturns, recordInnerDoubles, createSpyFromClass, warnOnUnknownMethods, warnOnAccessorNamingAMethod, resolveAccessors, createAccessorsSpies, ownerOf, createProxyPropStore, storeWriteTraps, describeStoredProp, hasStoredProp, isProtocolKey, isDeletedProp, readStoredAccessor, NOT_STORED, disposeAutoSpy, writeStoredValue } from './chunk-
|
|
1
|
+
import { mockValueProp, mockAccessorsProp } from './chunk-5GKIQX65.js';
|
|
2
|
+
import { resolveConfiguration, mergeAutoSpyDefaults, resolveReadGuard, mergeMethodNames, getCallableMemberNames, createTrackedPropSpy, applyConfiguredReturns, recordInnerDoubles, createSpyFromClass, warnOnUnknownMethods, warnOnAccessorNamingAMethod, resolveAccessors, createAccessorsSpies, ownerOf, createProxyPropStore, storeWriteTraps, describeStoredProp, hasStoredProp, isProtocolKey, isDeletedProp, readStoredAccessor, NOT_STORED, disposeAutoSpy, writeStoredValue } from './chunk-XLKBJSYQ.js';
|
|
3
3
|
import { fakeClockAdvice, fakeClockBacklog } from './chunk-SF4GKKN4.js';
|
|
4
4
|
import { unpatchedSetTimeout, unpatchedClearTimeout } from './chunk-SOROJD3W.js';
|
|
5
|
-
import { redefineFailure } from './chunk-
|
|
5
|
+
import { redefineFailure } from './chunk-QATP6Q3G.js';
|
|
6
6
|
import { DISPOSE } from './chunk-PC3FAZT3.js';
|
|
7
|
-
import { defineHelper, adoptFunctionSpy, reinstallDispatch, serializeValue, resolveUnstubbedGuard, createFunctionSpy } from './chunk-
|
|
8
|
-
import { isMarkedMock, reportMisconfiguration, DEEP_CHILDREN } from './chunk-
|
|
7
|
+
import { defineHelper, adoptFunctionSpy, reinstallDispatch, serializeValue, resolveUnstubbedGuard, createFunctionSpy } from './chunk-HIGHZ4BW.js';
|
|
8
|
+
import { isMarkedMock, reportMisconfiguration, DEEP_CHILDREN } from './chunk-2CWSOIBW.js';
|
|
9
9
|
import { count, displayPath } from './chunk-DYAS4OK4.js';
|
|
10
|
-
import { moduleMocksAssert, moduleMocksNoOp, narrow, adoptMock, observableFailures, strictModePassthrough, createSpyFromClassReturns, captureArg, eventLoopUntil, mockConstructor, createSpyFromClassLiveDomNode } from './chunk-
|
|
10
|
+
import { moduleMocksAssert, moduleMocksNoOp, narrow, adoptMock, observableFailures, strictModePassthrough, createSpyFromClassReturns, captureArg, eventLoopUntil, mockConstructor, createSpyFromClassLiveDomNode } from './chunk-7WU53KRS.js';
|
|
11
11
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
12
12
|
import { getMockAdapter, emissionTimeout, registerEmissionWait, forgetEmissionWait } from './shared-state.js';
|
|
13
13
|
export { describeDuplicateCopies, getPackageCopies, setEmissionTimeout } from './shared-state.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createRunnerMockAdapter } from './chunk-
|
|
1
|
+
import { createRunnerMockAdapter } from './chunk-EZTP5VUF.js';
|
|
2
2
|
import { SWEEP_SENTINEL } from './chunk-YHDBRBGU.js';
|
|
3
|
-
import { vitestModule, isFunction } from './chunk-
|
|
3
|
+
import { vitestModule, isFunction } from './chunk-DWMIQ7VO.js';
|
|
4
4
|
import { hasMockAdapter, registerMockAdapter } from './shared-state.js';
|
|
5
5
|
|
|
6
6
|
function prepareVitestSentinel(sentinel) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readSignalSymbol } from './chunk-T5MQSNRX.js';
|
|
2
|
-
import { angularInternalsError } from './chunk-
|
|
2
|
+
import { angularInternalsError } from './chunk-XZS56XV5.js';
|
|
3
3
|
import { signal } from '@angular/core';
|
|
4
4
|
import { getTestBed } from '@angular/core/testing';
|
|
5
5
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { currentSpecFile } from './chunk-
|
|
2
|
-
import { createSpyFromClass } from './chunk-
|
|
3
|
-
import { isAutoSpyLike, misconfigurationThrows, reportMisconfiguration } from './chunk-
|
|
1
|
+
import { currentSpecFile } from './chunk-5GKIQX65.js';
|
|
2
|
+
import { createSpyFromClass } from './chunk-XLKBJSYQ.js';
|
|
3
|
+
import { isAutoSpyLike, misconfigurationThrows, reportMisconfiguration } from './chunk-2CWSOIBW.js';
|
|
4
4
|
import { count, displayPath, sourceClassName } from './chunk-DYAS4OK4.js';
|
|
5
|
-
import { setup, angularComponentStub, angularInjectSpyReal, angularTestBedCopies, installationVitest } from './chunk-
|
|
5
|
+
import { setup, angularComponentStub, angularInjectSpyReal, angularTestBedCopies, installationVitest } from './chunk-7WU53KRS.js';
|
|
6
6
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
7
7
|
import { getTestBed, TestBed } from '@angular/core/testing';
|
|
8
8
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { realSeam, createSpyFromClass, autoMockByType, createSpyFromClassAccessorSpies } from './chunk-
|
|
1
|
+
import { realSeam, createSpyFromClass, autoMockByType, createSpyFromClassAccessorSpies } from './chunk-7WU53KRS.js';
|
|
2
2
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
3
3
|
|
|
4
4
|
// src/lib/redefine-failure.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DISPOSE } from './chunk-PC3FAZT3.js';
|
|
2
|
-
import { defaultStrict, resolveUnstubbedGuard, seedReturnValue, createFunctionSpy } from './chunk-
|
|
3
|
-
import { runClearHook, runConfigReset, reportMisconfiguration, AUTO_SPY_MARK, markAsMock, libraryWarn, isMarkedMock, readDeepChildren } from './chunk-
|
|
2
|
+
import { defaultStrict, resolveUnstubbedGuard, seedReturnValue, createFunctionSpy } from './chunk-HIGHZ4BW.js';
|
|
3
|
+
import { runClearHook, runConfigReset, reportMisconfiguration, AUTO_SPY_MARK, markAsMock, libraryWarn, isMarkedMock, readDeepChildren } from './chunk-2CWSOIBW.js';
|
|
4
4
|
import { sourceClassName } from './chunk-DYAS4OK4.js';
|
|
5
|
-
import { autoMockHeldBack, createSpyFromClassInstanceMethods, createSpyFromClassAccessors, createSpyFromClass, createSpyFromClassReturns, createSpyFromClassLazySpies } from './chunk-
|
|
5
|
+
import { autoMockHeldBack, createSpyFromClassInstanceMethods, createSpyFromClassAccessors, createSpyFromClass, createSpyFromClassReturns, createSpyFromClassLazySpies } from './chunk-7WU53KRS.js';
|
|
6
6
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
7
7
|
import { getMockAdapter, requireObservableSupport, getJasmineSupport } from './shared-state.js';
|
|
8
8
|
|
package/dist/cli.js
CHANGED
|
@@ -1667,7 +1667,7 @@ function foreignPragmaPass() {
|
|
|
1667
1667
|
}
|
|
1668
1668
|
|
|
1669
1669
|
// src/cli/checks/export-map.generated.ts
|
|
1670
|
-
var EXPORT_MAP_VERSION = "5.
|
|
1670
|
+
var EXPORT_MAP_VERSION = "5.65.0";
|
|
1671
1671
|
var ENTRY_SPECIFIERS = "vitest-auto-spy vitest-auto-spy/bun vitest-auto-spy/bun-angular vitest-auto-spy/node vitest-auto-spy/rstest vitest-auto-spy/rxjs vitest-auto-spy/console vitest-auto-spy/dom-stubs vitest-auto-spy/diagnostics vitest-auto-spy/jasmine vitest-auto-spy/jasmine-compat vitest-auto-spy/observer-spy vitest-auto-spy/angular vitest-auto-spy/angular/diagnostics vitest-auto-spy/angular/doubles vitest-auto-spy/angular/matchers vitest-auto-spy/angular-http vitest-auto-spy/angular-router vitest-auto-spy/signal-forms vitest-auto-spy/nestjs vitest-auto-spy/react vitest-auto-spy/vue vitest-auto-spy/svelte vitest-auto-spy/setup vitest-auto-spy/zone vitest-auto-spy/eslint-plugin vitest-auto-spy/perf-reporter";
|
|
1672
1672
|
var EXPORTED_BY = {
|
|
1673
1673
|
AccessorImplementations: "0 1 2 3 4 12 20 21 22",
|
|
@@ -1788,6 +1788,7 @@ var EXPORTED_BY = {
|
|
|
1788
1788
|
CreateFormOptions: "18",
|
|
1789
1789
|
createFunctionSpy: "0 1 2 3 4 9 20 21 22",
|
|
1790
1790
|
createGlobalRegistratorRegistrar: "2",
|
|
1791
|
+
createHttpExecutionContext: "19",
|
|
1791
1792
|
createInputEvent: "7",
|
|
1792
1793
|
createJsdomRegistrar: "2",
|
|
1793
1794
|
createLocationDouble: "17",
|
|
@@ -1908,6 +1909,7 @@ var EXPORTED_BY = {
|
|
|
1908
1909
|
intersectionEntry: "7",
|
|
1909
1910
|
IntersectionEntryOverrides: "7",
|
|
1910
1911
|
IntersectionObserverStubOptions: "7",
|
|
1912
|
+
invokeNestParamDecorator: "19",
|
|
1911
1913
|
isAngularUnitTestBuilder: "23",
|
|
1912
1914
|
jasmine: "9",
|
|
1913
1915
|
JasmineAccessorSpies: "9 10",
|
|
@@ -1961,7 +1963,12 @@ var EXPORTED_BY = {
|
|
|
1961
1963
|
narrow: "0 1 2 3 4 20 21 22",
|
|
1962
1964
|
NativeElementHolder: "2 12",
|
|
1963
1965
|
NavigationInit: "17",
|
|
1966
|
+
NestHttpArgumentsHost: "19",
|
|
1967
|
+
NestHttpContextClass: "19",
|
|
1968
|
+
NestHttpExecutionContext: "19",
|
|
1969
|
+
NestHttpExecutionContextOptions: "19",
|
|
1964
1970
|
NestModuleRef: "19",
|
|
1971
|
+
NestParamDecoratorMethod: "19",
|
|
1965
1972
|
NestUnit: "1 2 3 19",
|
|
1966
1973
|
NestUnitClass: "1 2 3 19",
|
|
1967
1974
|
NestUnitProvider: "1 2 3 19",
|
package/dist/console.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { useRunnerAdapter } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
import { useRunnerAdapter } from './chunk-NMXLXBXH.js';
|
|
2
|
+
import './chunk-EZTP5VUF.js';
|
|
3
3
|
import './chunk-YHDBRBGU.js';
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
4
|
+
import './chunk-EZKDQ4WO.js';
|
|
5
|
+
import './chunk-QATP6Q3G.js';
|
|
6
6
|
import './chunk-PC3FAZT3.js';
|
|
7
|
-
import { getRunnerHooks } from './chunk-
|
|
8
|
-
import { reinstallDispatch, createFunctionSpy } from './chunk-
|
|
9
|
-
import './chunk-
|
|
7
|
+
import { getRunnerHooks } from './chunk-DWMIQ7VO.js';
|
|
8
|
+
import { reinstallDispatch, createFunctionSpy } from './chunk-HIGHZ4BW.js';
|
|
9
|
+
import './chunk-2CWSOIBW.js';
|
|
10
10
|
import './chunk-DYAS4OK4.js';
|
|
11
|
-
import './chunk-
|
|
11
|
+
import './chunk-7WU53KRS.js';
|
|
12
12
|
import './chunk-ENCEEH23.js';
|
|
13
13
|
import { hasMockAdapter, getMockAdapter } from './shared-state.js';
|
|
14
14
|
|
package/dist/jasmine-compat.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { enableJasmineCompat } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { enableJasmineCompat } from './chunk-TRRI7TXE.js';
|
|
2
|
+
import './chunk-7WU53KRS.js';
|
|
3
3
|
import './chunk-ENCEEH23.js';
|
package/dist/jasmine.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { enableJasmineCompat } from './chunk-
|
|
2
|
-
export { enableJasmineCompat } from './chunk-
|
|
3
|
-
import { useVitestAdapter } from './chunk-
|
|
1
|
+
import { enableJasmineCompat } from './chunk-TRRI7TXE.js';
|
|
2
|
+
export { enableJasmineCompat } from './chunk-TRRI7TXE.js';
|
|
3
|
+
import { useVitestAdapter } from './chunk-IXARK3B6.js';
|
|
4
4
|
import { looseEquals } from './chunk-B6JUBFBA.js';
|
|
5
|
-
import { createSpyFromClass } from './chunk-
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
5
|
+
import { createSpyFromClass } from './chunk-XLKBJSYQ.js';
|
|
6
|
+
import './chunk-NMXLXBXH.js';
|
|
7
|
+
import './chunk-EZTP5VUF.js';
|
|
8
8
|
import './chunk-YHDBRBGU.js';
|
|
9
|
-
import './chunk-
|
|
10
|
-
import './chunk-
|
|
9
|
+
import './chunk-EZKDQ4WO.js';
|
|
10
|
+
import './chunk-QATP6Q3G.js';
|
|
11
11
|
import './chunk-PC3FAZT3.js';
|
|
12
|
-
import './chunk-
|
|
13
|
-
import { createFunctionSpy } from './chunk-
|
|
14
|
-
import { reportMisconfiguration, misconfigurationThrows } from './chunk-
|
|
12
|
+
import './chunk-DWMIQ7VO.js';
|
|
13
|
+
import { createFunctionSpy } from './chunk-HIGHZ4BW.js';
|
|
14
|
+
import { reportMisconfiguration, misconfigurationThrows } from './chunk-2CWSOIBW.js';
|
|
15
15
|
import './chunk-DYAS4OK4.js';
|
|
16
|
-
import { jasmineGlobals, jasmineClock, jasmineAutoSpies, jasmineTimeout } from './chunk-
|
|
16
|
+
import { jasmineGlobals, jasmineClock, jasmineAutoSpies, jasmineTimeout } from './chunk-7WU53KRS.js';
|
|
17
17
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
18
18
|
import { expect, vi } from 'vitest';
|
|
19
19
|
import { getMockAdapter } from './shared-state.js';
|
package/dist/nestjs.d.ts
CHANGED
|
@@ -47,4 +47,68 @@ declare function provideAutoSpy<T>(ObjectClass: ClassType<T>, methodsToSpyOnOrCo
|
|
|
47
47
|
*/
|
|
48
48
|
declare function injectSpy<T>(moduleRef: NestModuleRef, token: ClassType<T> | (abstract new (...args: never[]) => T)): Spy<T>;
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
/** A controller constructor, structurally compatible with Nest's `Type<T>`. */
|
|
51
|
+
type NestHttpContextClass<T = unknown> = new (...args: any[]) => T;
|
|
52
|
+
/** HTTP arguments supplied to {@link createHttpExecutionContext}. */
|
|
53
|
+
interface NestHttpExecutionContextOptions<TRequest = unknown, TResponse = unknown, TNext = unknown> {
|
|
54
|
+
request?: TRequest;
|
|
55
|
+
response?: TResponse;
|
|
56
|
+
next?: TNext;
|
|
57
|
+
/** The actual controller class, when the code under test reads controller metadata. */
|
|
58
|
+
class?: NestHttpContextClass;
|
|
59
|
+
/** The actual controller method, when the code under test reads handler metadata. */
|
|
60
|
+
handler?: (...args: never[]) => unknown;
|
|
61
|
+
}
|
|
62
|
+
/** The HTTP view of the same mutable argument array returned by `getArgs()`. */
|
|
63
|
+
interface NestHttpArgumentsHost<TRequest = unknown, TResponse = unknown, TNext = unknown> {
|
|
64
|
+
getRequest<T = TRequest>(): T;
|
|
65
|
+
getResponse<T = TResponse>(): T;
|
|
66
|
+
getNext<T = TNext>(): T;
|
|
67
|
+
}
|
|
68
|
+
/** The structural HTTP subset of Nest's ExecutionContext, including ArgumentsHost methods. */
|
|
69
|
+
interface NestHttpExecutionContext<TRequest = unknown, TResponse = unknown, TNext = unknown> {
|
|
70
|
+
getArgs<T extends unknown[] = unknown[]>(): T;
|
|
71
|
+
getArgByIndex<T = unknown>(index: number): T;
|
|
72
|
+
getType<TContext extends string = 'http'>(): TContext;
|
|
73
|
+
getClass<T = unknown>(): NestHttpContextClass<T>;
|
|
74
|
+
getHandler(): (...args: never[]) => unknown;
|
|
75
|
+
switchToHttp(): NestHttpArgumentsHost<TRequest, TResponse, TNext>;
|
|
76
|
+
switchToRpc(): never;
|
|
77
|
+
switchToWs(): never;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Build an HTTP ExecutionContext for a Nest guard, interceptor, filter or parameter decorator.
|
|
81
|
+
* No Nest runtime or HTTP adapter is loaded. Request, response and next keep their identities;
|
|
82
|
+
* omitted arguments are `undefined`, just like an empty slot in Nest's ExecutionContextHost.
|
|
83
|
+
*
|
|
84
|
+
* All argument accessors read one mutable `[request, response, next]` array. Updating the array
|
|
85
|
+
* returned by `getArgs()` therefore changes what `switchToHttp()` and `getArgByIndex()` read.
|
|
86
|
+
* The context always reports `http`; switching to RPC or WebSockets throws.
|
|
87
|
+
*
|
|
88
|
+
* Supply `class` or `handler` when the code under test reads metadata from them. Their accessors
|
|
89
|
+
* throw an instruction when omitted rather than supplying a fabricated metadata target.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const context = createHttpExecutionContext({ request: { headers: { authorization: 'test' } } });
|
|
94
|
+
* expect(guard.canActivate(context)).toBe(true);
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
declare function createHttpExecutionContext<TRequest = unknown, TResponse = unknown, TNext = unknown>(options?: NestHttpExecutionContextOptions<TRequest, TResponse, TNext>): NestHttpExecutionContext<TRequest, TResponse, TNext>;
|
|
98
|
+
|
|
99
|
+
/** Public callable instance members, including symbol-named handlers. */
|
|
100
|
+
type NestParamDecoratorMethod<T> = {
|
|
101
|
+
[K in keyof T]-?: T[K] extends (...args: never[]) => unknown ? K : never;
|
|
102
|
+
}[keyof T];
|
|
103
|
+
/**
|
|
104
|
+
* Invoke the custom parameter factory recorded by Nest's `createParamDecorator`.
|
|
105
|
+
*
|
|
106
|
+
* Pass the decorated controller class, handler name, zero-based parameter index and execution
|
|
107
|
+
* context. The stored decorator data is forwarded unchanged, as is its result (including a Promise).
|
|
108
|
+
* This tests the factory only: parameters with pipes or a schema are refused because Nest's
|
|
109
|
+
* validation pipeline is not run. Native decorators such as `@Body()` have no custom factory.
|
|
110
|
+
* Requires the consumer's `reflect-metadata` import; imports no Nest or runner code itself.
|
|
111
|
+
*/
|
|
112
|
+
declare function invokeNestParamDecorator<T>(Controller: ClassType<T>, method: NestParamDecoratorMethod<T> & (string | symbol), parameterIndex: number, context: object): unknown;
|
|
113
|
+
|
|
114
|
+
export { type NestHttpArgumentsHost, type NestHttpContextClass, type NestHttpExecutionContext, type NestHttpExecutionContextOptions, type NestModuleRef, type NestParamDecoratorMethod, type NestValueProvider, createHttpExecutionContext, injectSpy, invokeNestParamDecorator, provideAutoSpy };
|
package/dist/nestjs.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { createNestUnit, trackInjections } from './chunk-
|
|
2
|
-
import { createSpyFromClass } from './chunk-
|
|
3
|
-
import { useRunnerAdapter } from './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
export { createNestUnit, trackInjections } from './chunk-7GOVSGXB.js';
|
|
2
|
+
import { createSpyFromClass } from './chunk-XLKBJSYQ.js';
|
|
3
|
+
import { useRunnerAdapter } from './chunk-NMXLXBXH.js';
|
|
4
|
+
import './chunk-EZTP5VUF.js';
|
|
5
5
|
import './chunk-YHDBRBGU.js';
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
6
|
+
import './chunk-EZKDQ4WO.js';
|
|
7
|
+
import './chunk-QATP6Q3G.js';
|
|
8
8
|
import './chunk-PC3FAZT3.js';
|
|
9
|
-
import './chunk-
|
|
10
|
-
import './chunk-
|
|
11
|
-
import './chunk-
|
|
9
|
+
import './chunk-DWMIQ7VO.js';
|
|
10
|
+
import './chunk-HIGHZ4BW.js';
|
|
11
|
+
import './chunk-2CWSOIBW.js';
|
|
12
12
|
import './chunk-DYAS4OK4.js';
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-ENCEEH23.js';
|
|
13
|
+
import { nestHttpContext, nestParamDecorator } from './chunk-7WU53KRS.js';
|
|
14
|
+
import { withDocs } from './chunk-ENCEEH23.js';
|
|
15
15
|
|
|
16
16
|
// src/lib/nestjs.ts
|
|
17
17
|
function provideAutoSpy(ObjectClass, methodsToSpyOnOrConfig) {
|
|
@@ -25,7 +25,88 @@ function injectSpy(moduleRef, token) {
|
|
|
25
25
|
return injected;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
// src/lib/nest-http-context.ts
|
|
29
|
+
function argumentAs(value) {
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
function contextError(message) {
|
|
33
|
+
throw new Error(withDocs(`[vitest-auto-spy] createHttpExecutionContext(): ${message}`, nestHttpContext));
|
|
34
|
+
}
|
|
35
|
+
function createHttpExecutionContext(options = {}) {
|
|
36
|
+
const args = [options.request, options.response, options.next];
|
|
37
|
+
const http = {
|
|
38
|
+
getRequest: () => argumentAs(args[0]),
|
|
39
|
+
getResponse: () => argumentAs(args[1]),
|
|
40
|
+
getNext: () => argumentAs(args[2])
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
getArgs: () => argumentAs(args),
|
|
44
|
+
getArgByIndex: (index) => argumentAs(args[index]),
|
|
45
|
+
getType: () => argumentAs("http"),
|
|
46
|
+
getClass: () => {
|
|
47
|
+
if (options.class === void 0) {
|
|
48
|
+
contextError("pass { class: Controller } before calling getClass().");
|
|
49
|
+
}
|
|
50
|
+
return argumentAs(options.class);
|
|
51
|
+
},
|
|
52
|
+
getHandler: () => {
|
|
53
|
+
if (options.handler === void 0) {
|
|
54
|
+
contextError("pass { handler: Controller.prototype.method } before calling getHandler().");
|
|
55
|
+
}
|
|
56
|
+
return options.handler;
|
|
57
|
+
},
|
|
58
|
+
switchToHttp: () => http,
|
|
59
|
+
switchToRpc: () => contextError("supports HTTP only; switchToRpc() is unavailable."),
|
|
60
|
+
switchToWs: () => contextError("supports HTTP only; switchToWs() is unavailable.")
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// src/lib/nest-param-decorator.ts
|
|
65
|
+
function fail(message) {
|
|
66
|
+
return new Error(withDocs(`[vitest-auto-spy] invokeNestParamDecorator: ${message}`, nestParamDecorator));
|
|
67
|
+
}
|
|
68
|
+
function invokeNestParamDecorator(Controller, method, parameterIndex, context) {
|
|
69
|
+
if (!Number.isInteger(parameterIndex) || parameterIndex < 0) {
|
|
70
|
+
throw fail("parameterIndex must be a non-negative integer.");
|
|
71
|
+
}
|
|
72
|
+
const read = Reflect.get(Reflect, "getMetadata");
|
|
73
|
+
if (typeof read !== "function") {
|
|
74
|
+
throw fail('import "reflect-metadata" before reading Nest parameter decorator metadata.');
|
|
75
|
+
}
|
|
76
|
+
const metadata = read("__routeArguments__", Controller, method);
|
|
77
|
+
if (metadata === void 0) {
|
|
78
|
+
throw fail(`no parameter metadata for ${String(method)}; apply a Nest custom parameter decorator first.`);
|
|
79
|
+
}
|
|
80
|
+
if (metadata === null || typeof metadata !== "object" || Array.isArray(metadata)) {
|
|
81
|
+
throw fail(`invalid parameter metadata for ${String(method)}.`);
|
|
82
|
+
}
|
|
83
|
+
const records = Object.entries(metadata);
|
|
84
|
+
const entries = records.filter((record) => {
|
|
85
|
+
const [key, value] = record;
|
|
86
|
+
return key.endsWith(`__customRouteArgs__:${parameterIndex}`) && value !== null && typeof value === "object" && Reflect.get(value, "index") === parameterIndex;
|
|
87
|
+
});
|
|
88
|
+
const selected = entries.at(0);
|
|
89
|
+
if (!selected) {
|
|
90
|
+
throw fail(
|
|
91
|
+
`no custom parameter factory for ${String(method)} parameter #${parameterIndex}; native decorators such as @Body() are not supported.`
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
if (entries.length > 1) {
|
|
95
|
+
throw fail(`ambiguous custom parameter factories for ${String(method)} parameter #${parameterIndex}.`);
|
|
96
|
+
}
|
|
97
|
+
const entry = selected[1];
|
|
98
|
+
const factory = Reflect.get(entry, "factory");
|
|
99
|
+
const pipes = Reflect.get(entry, "pipes");
|
|
100
|
+
if (typeof factory !== "function") {
|
|
101
|
+
throw fail(`invalid custom parameter factory for ${String(method)} parameter #${parameterIndex}.`);
|
|
102
|
+
}
|
|
103
|
+
if (pipes !== void 0 && (!Array.isArray(pipes) || pipes.length > 0) || Reflect.get(entry, "schema") !== void 0) {
|
|
104
|
+
throw fail("parameters with pipes or a schema require the Nest validation pipeline; this helper invokes only the custom factory.");
|
|
105
|
+
}
|
|
106
|
+
return Reflect.apply(factory, void 0, [Reflect.get(entry, "data"), context]);
|
|
107
|
+
}
|
|
108
|
+
|
|
28
109
|
// src/nestjs.ts
|
|
29
110
|
useRunnerAdapter();
|
|
30
111
|
|
|
31
|
-
export { injectSpy, provideAutoSpy };
|
|
112
|
+
export { createHttpExecutionContext, injectSpy, invokeNestParamDecorator, provideAutoSpy };
|
package/dist/rstest.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, createDeferred, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromInstance, describeDuplicateCopies, expectAllEmissions, expectCompletion, expectEmission, expectEmissionSync, expectEmissions, expectEmissionsSync, expectError, expectNoEmission, expectNoEmissionSync, flushEventLoop, flushEventLoopUntil, getPackageCopies, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, restoreSpiedInstance, setEmissionTimeout, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './chunk-
|
|
2
|
-
export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, reportPropsOutsideHooks, restoreMockedProps } from './chunk-
|
|
3
|
-
export { autoMocked, clearAutoSpy, clearAutoSpyDefaults, createAutoMock, createSpyFromClass, innerDouble, registerAutoSpyDefaults, resetAutoSpy } from './chunk-
|
|
1
|
+
export { adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, createDeferred, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromInstance, describeDuplicateCopies, expectAllEmissions, expectCompletion, expectEmission, expectEmissionSync, expectEmissions, expectEmissionsSync, expectError, expectNoEmission, expectNoEmissionSync, flushEventLoop, flushEventLoopUntil, getPackageCopies, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, restoreSpiedInstance, setEmissionTimeout, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './chunk-KCQOZSNA.js';
|
|
2
|
+
export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, reportPropsOutsideHooks, restoreMockedProps } from './chunk-5GKIQX65.js';
|
|
3
|
+
export { autoMocked, clearAutoSpy, clearAutoSpyDefaults, createAutoMock, createSpyFromClass, innerDouble, registerAutoSpyDefaults, resetAutoSpy } from './chunk-XLKBJSYQ.js';
|
|
4
4
|
import './chunk-SF4GKKN4.js';
|
|
5
5
|
import './chunk-SOROJD3W.js';
|
|
6
|
-
import { createRunnerMockAdapter } from './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
6
|
+
import { createRunnerMockAdapter } from './chunk-EZTP5VUF.js';
|
|
7
|
+
import './chunk-EZKDQ4WO.js';
|
|
8
|
+
import './chunk-QATP6Q3G.js';
|
|
9
9
|
import './chunk-PC3FAZT3.js';
|
|
10
|
-
import { registerRunnerHooks } from './chunk-
|
|
11
|
-
export { createFunctionSpy, errorHandler } from './chunk-
|
|
12
|
-
import './chunk-
|
|
10
|
+
import { registerRunnerHooks } from './chunk-DWMIQ7VO.js';
|
|
11
|
+
export { createFunctionSpy, errorHandler } from './chunk-HIGHZ4BW.js';
|
|
12
|
+
import './chunk-2CWSOIBW.js';
|
|
13
13
|
import './chunk-DYAS4OK4.js';
|
|
14
|
-
import './chunk-
|
|
14
|
+
import './chunk-7WU53KRS.js';
|
|
15
15
|
import './chunk-ENCEEH23.js';
|
|
16
16
|
import { afterEach, beforeEach, rstest } from '@rstest/core';
|
|
17
17
|
import { registerMockAdapter } from './shared-state.js';
|
package/dist/rxjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { REPLAY_BUFFER_SIZE } from './chunk-YHDBRBGU.js';
|
|
2
|
-
import { decorate, attachHelpers, misconfigurationThrows, reportMisconfiguration, hooksOf, detachedHelperError } from './chunk-
|
|
3
|
-
import { nextWithValuesLate } from './chunk-
|
|
2
|
+
import { decorate, attachHelpers, misconfigurationThrows, reportMisconfiguration, hooksOf, detachedHelperError } from './chunk-2CWSOIBW.js';
|
|
3
|
+
import { nextWithValuesLate } from './chunk-7WU53KRS.js';
|
|
4
4
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
5
5
|
import { Observable, defer, ReplaySubject, from, concatMap, of, delay, takeWhile, timer, switchMap, throwError, EMPTY, merge, takeUntil, take } from 'rxjs';
|
|
6
6
|
import { registerObservableSupport } from './shared-state.js';
|
package/dist/signal-forms.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readSignalSymbol } from './chunk-T5MQSNRX.js';
|
|
2
|
-
import { signalFormsErrors, signalFormsCreate } from './chunk-
|
|
2
|
+
import { signalFormsErrors, signalFormsCreate } from './chunk-7WU53KRS.js';
|
|
3
3
|
import { withDocs } from './chunk-ENCEEH23.js';
|
|
4
4
|
import { Injector, isSignal, signal } from '@angular/core';
|
|
5
5
|
import { TestBed } from '@angular/core/testing';
|
package/dist/zone.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest-auto-spy",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.66.0",
|
|
4
4
|
"description": "Auto-generate fully-typed test spies from a class — across Vitest, Bun, node:test and Rstest, with Angular/NestJS/React/Vue/Svelte recipes. Drop-in replacement for jest-auto-spies and jasmine-auto-spies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"auto-mock",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: vitest-auto-spy
|
|
3
|
-
description: Typed spies on Vitest, bun:test, node:test and Rstest. Use when a spec imports vitest-auto-spy
|
|
3
|
+
description: Typed spies on Vitest, bun:test, node:test and Rstest. Use when a spec imports vitest-auto-spy or its subpaths, naming createSpyFromClass, createAutoMock, createMock, mockDeep, subscribeSpyTo, provideAutoSpy, createWindowSpies, provideHttpTesting, expectRequest, stubResponse, injectSpy, createNestUnit, createHttpExecutionContext, invokeNestParamDecorator, extendWithAutoSpies, renderShallow, createWithAutoSpies, enableAngularDiagnostics, trackInjections, runEffect, settleResource, mockResourceProp, mockSignalProp, mockReadonlyProp, registerAutoSpyDefaults, provideActivatedRoute, provideLocationDouble, collectRouterEvents, createLog, createComponentStub, createForm, toHaveFieldErrors, stubWebStorage, assertNoShadowedProviders, createSpyFromInstance, adoptMock, spyOnOwnMethod, spyOnVoidMethod, explainSpy, compareTestRuns, expectEmission, setupAutoSpy, setSpyEngine, assertMocked, calledWith, mustBeCalledWith, captureArg, ArgumentCaptor, onlyMethodsToSpyOn, onUnstubbedCall, passthrough, resolveWith or nextWith, migrating off jest-auto-spies, jasmine-auto-spies or @ngneat/spectator, or a test fails with "No mock adapter registered", "Observable spies require rxjs", "not a method of", "strict double has nothing configured", "the override did not apply", "is not a constructor", "Expected to be running in 'ProxyZone'", "jasmine is not defined", "no HttpTestingController", "localStorage.setItem is not a function" or "Spy<T> is not assignable".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# vitest-auto-spy
|
|
@@ -216,6 +216,8 @@ Timers or promises require the async emission helpers.
|
|
|
216
216
|
| a guard or a class built with `new` that takes the route | `createActivatedRoute({ params })` — the same handle, no `TestBed` |
|
|
217
217
|
| a node:test suite whose heap grows all run | `trackNodeMocks()` — `/node`, a private MockTracker |
|
|
218
218
|
| a Nest provider whose constructor keeps changing | `createNestUnit(Target, { expose })` — built from its DI metadata |
|
|
219
|
+
| a Nest guard, interceptor or filter that reads HTTP context | `createHttpExecutionContext({ request, response, handler, class: Controller })` from `/nestjs` — omit unused options |
|
|
220
|
+
| a custom Nest parameter decorator under test | `invokeNestParamDecorator(Controller, 'method', index, context)` from `/nestjs` — zero-based index, recorded data; pipes and schemas require Nest's pipeline |
|
|
219
221
|
| asserting a resource's value _and_ status together | `registerResourceMatchers()` (`/angular/matchers`) → `toHaveResourceValue` / `toBeLoading` |
|
|
220
222
|
| a callback or config object the code under test built | `captureArg<T>()` in the assertion, then read `.value`; `{ where }` records only what it accepts |
|
|
221
223
|
| an object the test already holds — a real service, a client, `TestBed.inject(X)` | `createSpyFromInstance(obj, config?)` — patches it in place, `restoreSpiedInstance` undoes it |
|