vitest-auto-spy 5.42.0 → 5.43.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/CHANGELOG.md +45 -1
- package/README.md +18 -13
- package/agent-docs/angular.md +7 -5
- package/agent-docs/checklist.md +4 -2
- package/agent-docs/configuration.md +3 -2
- package/dist/angular-doubles.d.ts +1 -1
- package/dist/angular-matchers.d.ts +11 -3
- package/dist/angular-matchers.js +16 -9
- package/dist/angular-router.d.ts +2 -2
- package/dist/angular.d.ts +7 -7
- package/dist/angular.js +1 -1
- package/dist/bun-angular.d.ts +5 -5
- package/dist/bun-angular.js +1 -1
- package/dist/bun.d.ts +5 -5
- package/dist/{chunk-25QOHNGU.js → chunk-XXAGPAZR.js} +1 -1
- package/dist/cli.js +7 -4
- package/dist/console.d.ts +1 -1
- package/dist/dom-stubs.d.ts +2 -2
- package/dist/{expect-emission-D273986K.d.ts → expect-emission-D7DaPI5H.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/jasmine-compat.d.ts +1 -1
- package/dist/jasmine.d.ts +2 -2
- package/dist/nestjs.d.ts +2 -2
- package/dist/nestjs.js +2 -2
- package/dist/node.d.ts +4 -4
- package/dist/{package-identity-BnqwTQIn.d.ts → package-identity-C362z4w-.d.ts} +1 -1
- package/dist/{prop-mock-Cz0yKWEP.d.ts → prop-mock-e7qpfqY1.d.ts} +1 -1
- package/dist/react.d.ts +4 -4
- package/dist/rstest.d.ts +4 -4
- package/dist/rxjs.d.ts +2 -2
- package/dist/setup.d.ts +3 -3
- package/dist/svelte.d.ts +4 -4
- package/dist/{track-injections-BTJKOqWz.d.ts → track-injections-CkVuJHr_.d.ts} +10 -4
- package/dist/{track-signal-runs-bs2umXNE.d.ts → track-signal-runs-B3noexlc.d.ts} +3 -3
- package/dist/{types-CyRUgJVd.d.ts → types-CaGn5uvo.d.ts} +2 -1
- package/dist/vue.d.ts +5 -5
- package/package.json +1 -1
- package/skills/vitest-auto-spy/SKILL.md +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,49 @@ The latest released version here must always match the one published on
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [5.43.0] - 2026-09-27
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **`trackInjections(...).names({ clean: true })`.** `names()` returns each token's `Function.name`
|
|
18
|
+
as is, so under esbuild a decorated `FeatureFlagService` came back as `_FeatureFlagService` while
|
|
19
|
+
`get()` and every message printed the clean name. The option takes the rename off (the leading `_`,
|
|
20
|
+
Rollup's `$1`); without it the result is unchanged.
|
|
21
|
+
- **`toHaveSignalValue(expected, { strict: true })`.** The matcher compares the way `toEqual` does, so
|
|
22
|
+
`signal({ color: undefined })` passed against `{}` and a class instance against a plain object; a
|
|
23
|
+
spec on `expect(sig()).toStrictEqual(x)` lost precision by moving to it. `strict` counts
|
|
24
|
+
`undefined` properties, array holes and the object's class, as `toStrictEqual` does. The options
|
|
25
|
+
type is exported from `/angular/matchers` as `SignalValueOptions`. `/angular/matchers` is +137 B
|
|
26
|
+
min+gzip (2662 → 2799 B, +5.1 %) and +0.6 kB to import (22349 → 22906 B): the strict comparison,
|
|
27
|
+
its class tester, and the structural-directive message below.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- **`angular-build-istanbul-module-cache` puts its −46 % in range.** A second suite, 862 spec files on
|
|
32
|
+
`@angular/build` 22.2 and Vitest 5.0.2, gained −19 % from the cache (48 → 39 s), while switching it
|
|
33
|
+
to v8 ran in 19–22 s, about twice as fast as istanbul with the cache, on 7.5–8 GB RSS against
|
|
34
|
+
10–11 GB. The finding now gives −46 % as "up to", adds that data point, says the cache pays off on
|
|
35
|
+
CI only when CI keeps `node_modules/.vitest-cache`, and its fix offers `coverage.provider: 'v8'` as
|
|
36
|
+
the alternative. Still an info.
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- **`toHaveDirectiveApplied(Structural, selector)` no longer sends a structural directive to
|
|
41
|
+
`detectChanges()`.** When the directive rendered nothing the selector names, the failure said no
|
|
42
|
+
element matches and to run `fixture.detectChanges()`, which changes nothing. It now says the
|
|
43
|
+
directive is on a template anchor, that the element exists only in a view the directive chose to
|
|
44
|
+
render, and to assert without a selector.
|
|
45
|
+
- **Docs that disagreed with 5.41–5.42.** The performance table and README called the
|
|
46
|
+
`lazySpies: true` path "the default" (a class of 8+ methods now gets `'proxy'`) and said lazy spies
|
|
47
|
+
change no behaviour; the width is now defined as the methods the double spies, after
|
|
48
|
+
`onlyMethodsToSpyOn` / `methodsToSpyOn`. The Russian Angular page carried the pre-4.1 speed table.
|
|
49
|
+
The strict-mode and control-helper pages now say a delegating `mockImplementation` and `vi.when` are
|
|
50
|
+
not reported, and a `vi.when` over a `mockReturnValue` is. The CLI page counts `ng-test` among the
|
|
51
|
+
commands, says it exits with `ng`'s code, lists its exit-2 cases, that `--related` takes a
|
|
52
|
+
comma-separated list and that the builder compiles only included specs from `@angular/build` 22.2
|
|
53
|
+
(also in `--help`); the Russian CLI page gains the exit-code table. `RouteResources` is `never` up
|
|
54
|
+
to router 22.1, not only on 20 and 21.
|
|
55
|
+
|
|
13
56
|
## [5.42.0] - 2026-09-27
|
|
14
57
|
|
|
15
58
|
### Added
|
|
@@ -5692,7 +5735,8 @@ moved under 1 %: `/angular` +192 B (+1.0 %) for the override queue and the HTTP
|
|
|
5692
5735
|
This copy ships with the package and carries 5.x only. Releases before 5.0.0 are in the
|
|
5693
5736
|
[full changelog](https://github.com/ASDAlexey/vitest-auto-spy/blob/master/CHANGELOG.md).
|
|
5694
5737
|
|
|
5695
|
-
[Unreleased]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.
|
|
5738
|
+
[Unreleased]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.43.0...HEAD
|
|
5739
|
+
[5.43.0]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.42.0...v5.43.0
|
|
5696
5740
|
[5.42.0]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.41.0...v5.42.0
|
|
5697
5741
|
[5.41.0]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.40.1...v5.41.0
|
|
5698
5742
|
[5.40.1]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.40.0...v5.40.1
|
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ faster at suite scale ([benchmarks](#benchmarks)) — and for
|
|
|
83
83
|
- 🚚 A migration you can verify — `vitest-auto-spy/diagnostics`: `compareTestRuns` on the two JSON reports, `summarizeTestRun` / `formatTestRunComparison` to read the answer, `diffByField` for the assertion the reporter collapses, `explainSpy` for a double that answered something you did not configure
|
|
84
84
|
- 📏 Lint rules and one-line test-run hygiene — forty-nine rules in `vitest-auto-spy/eslint-plugin` (six `--fix`, nineteen suggestions, four of them for a suite mid-migration off jasmine), `setupAutoSpy()` — with `preset: 'strict'` for every guard at its strictest grade, and under `isolate: false` `strayListeners` / `restoreGlobals` for the listeners and raw global assignments a file leaves the next one, `restoreStorageSpies` (on by default) for the storage spy happy-dom will not let `mockRestore()` remove
|
|
85
85
|
- 🩺 [Editor diagnostics](#editor-diagnostics--webstorm--vs-code) — the same anti-patterns underlined while you type: native ESLint inspections in **WebStorm** and the other JetBrains IDEs, the ESLint extension in **VS Code**, no extra plugin either way
|
|
86
|
-
- 🔎 [`npx vitest-auto-spy doctor`](#the-cli--doctor-perf-codemod-and-
|
|
86
|
+
- 🔎 [`npx vitest-auto-spy doctor`](#the-cli--doctor-perf-codemod-init-and-ng-test) — suite-level defects **that never fail a run**: a `tsconfig` `include` matching no file, a production module importing a spec, a `@jest-environment` pragma the runner never reads, config left behind for a runner that is gone. Read-only, no config, exits 1 in CI
|
|
87
87
|
- ⏱️ [`npx vitest-auto-spy perf`](#perf--where-the-cpu-time-actually-goes) — where a suite's CPU time actually goes, phase by phase, and which spec files to act on: the ones that reach no DOM and could run under `node`, the ones that import a barrel. Runs Vitest once with a reporter this package ships, reads `TestModule.diagnostic()`, names files, states the rule behind each finding
|
|
88
88
|
- 🚚 [`npx vitest-auto-spy codemod`](#codemod--migrating-a-suite-off-jest-auto-spies) — thirteen transforms that move a suite off `jest-auto-spies` and Jest, or off `jasmine-auto-spies` and jasmine (`--from jasmine`), dry-run by default, with a `--verify` pass that also checks a file somebody edited by hand
|
|
89
89
|
- 🔇 Console spies — `import { consoleInfoSpy } from 'vitest-auto-spy/console'` silences `console` and asserts its calls; [`setupAutoSpy({ strayConsole: 'throw' })`](#how-to-mock-the-console) fails any test whose console output nothing absorbed
|
|
@@ -126,7 +126,7 @@ faster at suite scale ([benchmarks](#benchmarks)) — and for
|
|
|
126
126
|
- [A jasmine suite mid-migration](#how-to-mock-a-jasmine-suite-mid-migration)
|
|
127
127
|
- [New in 5](#new-in-5)
|
|
128
128
|
- [New in 4](#new-in-4)
|
|
129
|
-
- [The CLI — `doctor`, `perf`, `codemod` and `
|
|
129
|
+
- [The CLI — `doctor`, `perf`, `codemod`, `init` and `ng-test`](#the-cli--doctor-perf-codemod-init-and-ng-test)
|
|
130
130
|
- [`doctor` — defects that never fail](#doctor--defects-that-never-fail)
|
|
131
131
|
- [`perf` — where the CPU time actually goes](#perf--where-the-cpu-time-actually-goes)
|
|
132
132
|
- [`codemod` — migrating a suite off `jest-auto-spies`](#codemod--migrating-a-suite-off-jest-auto-spies)
|
|
@@ -989,7 +989,7 @@ a `.d.ts` your `tsconfig` includes — that one import is what keeps `returnSubj
|
|
|
989
989
|
own `Subject<T>`. From `@angular/build:unit-test` 22.2.0 the test program is the specs, the setup
|
|
990
990
|
files and the `.d.ts` files, so a plain `.ts` listed only in the spec `tsconfig`'s `include` is out.
|
|
991
991
|
|
|
992
|
-
## The CLI — `doctor`, `perf`, `codemod` and `
|
|
992
|
+
## The CLI — `doctor`, `perf`, `codemod`, `init` and `ng-test`
|
|
993
993
|
|
|
994
994
|
The package ships one executable, with no dependencies and nothing to configure:
|
|
995
995
|
|
|
@@ -1007,7 +1007,7 @@ passes neither Vitest's `--shard` nor its `--changed` through, so it picks the s
|
|
|
1007
1007
|
them to the builder as `--include` paths.
|
|
1008
1008
|
|
|
1009
1009
|
**Exit `0` means "ran, nothing to report"; `1` means "ran, and here is the finding"; `2` means
|
|
1010
|
-
"there was nothing to judge".** The third one is the reason to read this line: an unknown flag for a
|
|
1010
|
+
"there was nothing to judge".** (`ng-test` passes `ng`'s own exit code through once it runs.) The third one is the reason to read this line: an unknown flag for a
|
|
1011
1011
|
known command is an error and **nothing runs** — `init --dryrun` used to write the files and
|
|
1012
1012
|
`perf --gat` used to pass with no gate at all, which is a typo that reads as a clean CI step. A path
|
|
1013
1013
|
that matches no file is the same kind of error, because _Nothing left to migrate_ off a tree nobody
|
|
@@ -1055,7 +1055,7 @@ error tsconfig-glob-matches-nothing libs/users/tsconfig.spec.json
|
|
|
1055
1055
|
| `analog-behind-angular-build` | `@analogjs/vite-plugin-angular` below 2.7.5 next to `@angular/build` 22.2+ — `TypeError: cache.has is not a function` at startup |
|
|
1056
1056
|
| `analog-fast-compile-ctor-injection` | Analog `fastCompile` in JIT mode with an `@Injectable` whose constructor parameter is known only by its type — NG0202 at injection |
|
|
1057
1057
|
| `analog-module-cache-inline-styles` | `fsModuleCache` on under the Analog plugin with a component that has inline `styles` — the warm run fails on `virtual:angular:jit:style:inline` |
|
|
1058
|
-
| `angular-build-istanbul-module-cache` | istanbul coverage under the unit-test builder (not in `browsers`) without `fsModuleCache` — −46
|
|
1058
|
+
| `angular-build-istanbul-module-cache` | istanbul coverage under the unit-test builder (not in `browsers`) without `fsModuleCache` — up to −46 %; v8 beat istanbul with the cache ~2x. Info |
|
|
1059
1059
|
| `angular-build-happy-dom` | jsdom only because `happy-dom` is not installed; the builder picks it by itself from 21 — −4.6 % wall, −6 % RSS. Info |
|
|
1060
1060
|
| `coverage-all-removed` | `coverage.all` in a config, on a Vitest that stopped reading the key |
|
|
1061
1061
|
| `coverage-include-misses-bundle` | A `coverage.include` of sources only, in a runner config over a bundle |
|
|
@@ -2422,7 +2422,9 @@ expect(() => myService.getName(2)).toThrow();
|
|
|
2422
2422
|
install an implementation on the host mock, and the dispatch that reads a `calledWith` chain **is**
|
|
2423
2423
|
the implementation they replace — so the one written later wins outright and the other decides
|
|
2424
2424
|
nothing, in either order, without failing. Both orders are now reported as a misconfiguration (a
|
|
2425
|
-
warning, a throw under the `strict` preset)
|
|
2425
|
+
warning, a throw under the `strict` preset) — except a wrapper that delegates, `vi.when(spy)` on
|
|
2426
|
+
Vitest 5 or a `mockImplementation` built from `spy.getMockImplementation()`, which the chain still
|
|
2427
|
+
answers through. Where both are wanted, the fallback goes in the spy's
|
|
2426
2428
|
own container, which a chain still wins over: the `returns` option where the double is built, or
|
|
2427
2429
|
`resolveWith` / `nextWith` / `failWith`. The report comes from this library's own spy engine — so
|
|
2428
2430
|
Vitest and Rstest, not Bun or `node:test`, and not under `setSpyEngine('runner')` — and the `Once`
|
|
@@ -2656,11 +2658,12 @@ beforeEach(() => {
|
|
|
2656
2658
|
> `@angular/build` 22.2 or newer, both `@analogjs` packages need 2.7.5 or newer — older ones crash at
|
|
2657
2659
|
> startup with `TypeError: cache.has is not a function`.
|
|
2658
2660
|
|
|
2659
|
-
> **Lazy by default
|
|
2661
|
+
> **Lazy by default.** `createSpyFromClass` and `provideAutoSpy` build each method spy on first access
|
|
2660
2662
|
> (accessor placeholders below 8 methods, a `Proxy` from 8), since Angular tests typically spy a wide service but call
|
|
2661
2663
|
> only a few of its methods — and the margin widens as the class does: **1.4×** on a ten-method
|
|
2662
|
-
> class a test calls twice, **1.9×** on a forty-method one it calls three times.
|
|
2663
|
-
>
|
|
2664
|
+
> class a test calls twice, **1.9×** on a forty-method one it calls three times. Calls, `Object.keys`,
|
|
2665
|
+
> spread and snapshots behave the same; a wide class's double is a `Proxy`, so pass
|
|
2666
|
+
> `{ lazySpies: true }` for a plain object, or `{ lazySpies: false }` to build every spy eagerly.
|
|
2664
2667
|
|
|
2665
2668
|
#### Signal / readonly property mocking (bonus)
|
|
2666
2669
|
|
|
@@ -2930,8 +2933,9 @@ expect(component.items).toHaveSignalValue([{ id: 1 }]);
|
|
|
2930
2933
|
```
|
|
2931
2934
|
|
|
2932
2935
|
`expect(component.total).toBeTruthy()` passes for every signal ever created — a signal is a
|
|
2933
|
-
function. The matcher reads it, deep-compares
|
|
2934
|
-
|
|
2936
|
+
function. The matcher reads it, deep-compares (as `toEqual` does; `{ strict: true }` as
|
|
2937
|
+
`toStrictEqual` does), and rejects anything that is not a zero-argument getter, so the
|
|
2938
|
+
missing-parentheses mistake fails instead of quietly passing.
|
|
2935
2939
|
|
|
2936
2940
|
#### Where a spec spends its time
|
|
2937
2941
|
|
|
@@ -3032,7 +3036,7 @@ collaborators.get(FeatureFlagService).isOn.mockReturnValue(true);
|
|
|
3032
3036
|
|
|
3033
3037
|
TestBed.inject(CheckoutFacade).start();
|
|
3034
3038
|
|
|
3035
|
-
expect(collaborators.names()).toEqual(['FeatureFlagService']); // analytics was never asked for
|
|
3039
|
+
expect(collaborators.names({ clean: true })).toEqual(['FeatureFlagService']); // analytics was never asked for
|
|
3036
3040
|
```
|
|
3037
3041
|
|
|
3038
3042
|
The assertion behind most `vi.mock('@app/services')` calls is not "this module was replaced" — it is
|
|
@@ -3061,7 +3065,8 @@ injectActivatedRoute().setParams({ id: '8' }); // params and paramMap emit; snap
|
|
|
3061
3065
|
has neither, and a hand-written `useValue` usually has one half — the component that reads the other
|
|
3062
3066
|
gets `undefined`, or a spec tests a route no navigation can produce. The double here is Angular's own
|
|
3063
3067
|
`ActivatedRoute` over one record: `params`, `queryParams`, `data`, `fragment`, `url`, both
|
|
3064
|
-
`ParamMap`s and `snapshot` come from the same values
|
|
3068
|
+
`ParamMap`s and `snapshot` come from the same values (plus `title`, `children` and, on Angular 22.2+,
|
|
3069
|
+
the `resources` record), and each setter (`setParams`,
|
|
3065
3070
|
`setQueryParams`, `setData`, `setFragment`, `setUrl`, or `set({ … })` for several at once) rebuilds
|
|
3066
3071
|
the snapshot first and then emits what changed, in the router's order and with its equality. It is a
|
|
3067
3072
|
real route to the real `Router` too: `relativeTo` resolves against its `url`. `createActivatedRoute()`
|
package/agent-docs/angular.md
CHANGED
|
@@ -538,8 +538,9 @@ Four things to know:
|
|
|
538
538
|
- **List it after `provideRouter()`** — the later provider of `ActivatedRoute` wins, and
|
|
539
539
|
`injectActivatedRoute()` throws naming the one that did. With the real router present, the double
|
|
540
540
|
still works as `relativeTo` for `router.createUrlTree`.
|
|
541
|
-
- **
|
|
542
|
-
`route.parent.params` patch that member with
|
|
541
|
+
- **No parent above it.** `root` is the route itself and `parent` is `null`; below it there are only
|
|
542
|
+
the routes passed as `children`. For `route.parent.params` patch that member with
|
|
543
|
+
`mockReadonlyProp`, or use `RouterTestingHarness`.
|
|
543
544
|
- **`title` is given, not resolved; no navigation, no input binding.** `provideActivatedRoute({
|
|
544
545
|
title: 'Product 7' })` answers `route.snapshot.title` — the double puts the string under the
|
|
545
546
|
router's own `RouteTitleKey`, read off the installed router, and does not run a `title: () => …`
|
|
@@ -857,10 +858,11 @@ collaborators.get(FeatureFlagService).isOn.mockReturnValue(true);
|
|
|
857
858
|
|
|
858
859
|
TestBed.inject(CheckoutFacade).start();
|
|
859
860
|
|
|
860
|
-
expect(collaborators.names()).toEqual(['FeatureFlagService']); // analytics was never asked for
|
|
861
|
+
expect(collaborators.names({ clean: true })).toEqual(['FeatureFlagService']); // analytics was never asked for
|
|
861
862
|
```
|
|
862
863
|
|
|
863
|
-
`providers`, `injectedTokens()` (in factory-run order), `names()`, `
|
|
864
|
+
`providers`, `injectedTokens()` (in factory-run order), `names()` (raw `Function.name`, so `_Service`
|
|
865
|
+
under esbuild; `names({ clean: true })` strips the rename), `wasInjected(token)`,
|
|
864
866
|
`get<D>(token)` → `Spy<D>`, `reset()` (the record only — the doubles survive). A class token gets a
|
|
865
867
|
class spy, anything else a `createAutoMock()`; pass `{ double: () => … }` when a collaborator has to
|
|
866
868
|
be a real object. Doubles are built eagerly, so stub before the entry point runs; a factory runs once
|
|
@@ -1025,7 +1027,7 @@ expect(products.reload).toHaveBeenCalled(); // reload is spied, answers true, an
|
|
|
1025
1027
|
|
|
1026
1028
|
// signal assertions
|
|
1027
1029
|
registerSignalMatchers(); // once, in the setup file — /angular/matchers
|
|
1028
|
-
expect(component.total).toHaveSignalValue(3);
|
|
1030
|
+
expect(component.total).toHaveSignalValue(3); // toEqual semantics; { strict: true } for toStrictEqual's
|
|
1029
1031
|
|
|
1030
1032
|
// resource assertions — value AND status, which is the whole point
|
|
1031
1033
|
registerResourceMatchers(); // once, in the setup file — /angular/matchers
|
package/agent-docs/checklist.md
CHANGED
|
@@ -52,7 +52,9 @@ a unit-test target, Analog below 2.7.5, `vite` below 6.4, or Node below 22.12 in
|
|
|
52
52
|
honours (`experimental.fsModuleCache`, `browser.isolate`, `cache.dir`, …) are left to Vitest's own
|
|
53
53
|
deprecation line. Four more cover the Angular unit-test builder and Analog:
|
|
54
54
|
`angular-build-istanbul-module-cache` notes an istanbul run under `@angular/build:unit-test` 21+ on
|
|
55
|
-
Vitest 5 without `fsModuleCache` in the target's runner config (−46 %
|
|
55
|
+
Vitest 5 without `fsModuleCache` in the target's runner config (up to −46 %, −19 % on another suite;
|
|
56
|
+
v8 was about 2x faster than istanbul with the cache there, and the cache pays off on CI only when
|
|
57
|
+
`node_modules/.vitest-cache` is kept), and
|
|
56
58
|
`analog-module-cache-inline-styles` warns that `fsModuleCache` under the Analog plugin breaks the
|
|
57
59
|
warm run of any spec reaching a component with inline `styles`. `angular-build-happy-dom` notes a
|
|
58
60
|
builder target on jsdom only because `happy-dom` is not installed.
|
|
@@ -141,7 +143,7 @@ totals are CPU time summed across every worker, not wall clock** — a report sh
|
|
|
141
143
|
time` under `986ms wall clock` is not a bug, it is the work spread over workers.
|
|
142
144
|
|
|
143
145
|
Under `@angular/build:unit-test`, `ng test` takes no Vitest flag. Shard or run only what a change
|
|
144
|
-
reaches with `npx vitest-auto-spy ng-test --shard 1/4` / `--changed [ref]` / `--related
|
|
146
|
+
reaches with `npx vitest-auto-spy ng-test --shard 1/4` / `--changed [ref]` / `--related a.ts,b.ts`
|
|
145
147
|
(`@angular/build` 21+; everything after `--` goes to `ng`); `test.repeats` in the runner config
|
|
146
148
|
reaches Vitest as it is. `vitest doctor` does not work there — use `perf --command`.
|
|
147
149
|
|
|
@@ -28,7 +28,7 @@ createSpyFromClass(MyService, {
|
|
|
28
28
|
| `onlyMethodsToSpyOn` | **Exhaustive whitelist.** Skips discovery; anything not listed is absent. |
|
|
29
29
|
| `instanceMethodsToSpyOn` | **Additive.** The name to prefer in new code (see below). |
|
|
30
30
|
| `autoSpyAccessors` | Merged with the explicit getter/setter lists. |
|
|
31
|
-
| `lazySpies` | Unset: `true` (accessor placeholders) below 8 methods, `'proxy'` (a `Proxy`, lighter once touched) from 8. Explicit `true` / `false` / `'proxy'` apply at any width. Calls, `Object.keys`, spread and snapshots behave the same in every mode. |
|
|
31
|
+
| `lazySpies` | Unset: `true` (accessor placeholders) below 8 methods, `'proxy'` (a `Proxy`, lighter once touched) from 8, counting the methods the double spies (after `onlyMethodsToSpyOn` / `methodsToSpyOn`). Explicit `true` / `false` / `'proxy'` apply at any width. Calls, `Object.keys`, spread and snapshots behave the same in every mode. |
|
|
32
32
|
| `strict` | Throw on a method nobody configured, instead of answering `undefined` (below). |
|
|
33
33
|
| `onUnstubbedCall` | The general form of `strict`; its return value becomes the call's return value. |
|
|
34
34
|
| `selfReturning` | The named methods answer the double itself — a default like `returns`; a name in both answers `returns`. |
|
|
@@ -251,7 +251,8 @@ Precedence, first one set wins: the double's `onUnstubbedCall` → the double's
|
|
|
251
251
|
double is built, or `resolveWith` / `nextWith` / `failWith` — which a `calledWith` still wins over.
|
|
252
252
|
The report is this library's own spy engine's, so Vitest and Rstest have it; Bun, `node:test` and
|
|
253
253
|
`setSpyEngine('runner')` do not. The `Once` family is never reported.
|
|
254
|
-
`vi.when(spy)` (Vitest 5) is not reported either
|
|
254
|
+
`vi.when(spy)` (Vitest 5) is not reported either, nor any `mockImplementation` built from
|
|
255
|
+
`spy.getMockImplementation()`: it wraps the dispatch rather than replacing it,
|
|
255
256
|
so a `calledWith` on the same method still answers every call `vi.when` has no row for. A
|
|
256
257
|
`vi.when` over a `mockReturnValue` still is.
|
|
257
258
|
- **A throw something swallowed still fails the test.** Under `setupAutoSpy({ strict: true })` every
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InjectionToken, AbstractType, Injector, ValueProvider, FactoryProvider, ProviderToken } from '@angular/core';
|
|
2
|
-
import { h as AddSpyMethodsByReturnTypes } from './types-
|
|
2
|
+
import { h as AddSpyMethodsByReturnTypes } from './types-CaGn5uvo.js';
|
|
3
3
|
import 'vitest';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -76,11 +76,19 @@ type SignalLike<T> = () => T;
|
|
|
76
76
|
declare global {
|
|
77
77
|
namespace Chai {
|
|
78
78
|
interface Assertion {
|
|
79
|
-
/**
|
|
80
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Read the signal under test and deep-compare its current value, with `toEqual` semantics;
|
|
81
|
+
* `{ strict: true }` compares the way `toStrictEqual` does.
|
|
82
|
+
*/
|
|
83
|
+
toHaveSignalValue(expected: unknown, options?: SignalValueOptions): void;
|
|
81
84
|
}
|
|
82
85
|
}
|
|
83
86
|
}
|
|
87
|
+
/** How {@link registerSignalMatchers}' `toHaveSignalValue` compares. */
|
|
88
|
+
interface SignalValueOptions {
|
|
89
|
+
/** Count `undefined` properties, array holes and the object's class, as `toStrictEqual` does. */
|
|
90
|
+
readonly strict?: boolean;
|
|
91
|
+
}
|
|
84
92
|
/**
|
|
85
93
|
* Register {@link toHaveSignalValue} with the runner. Call once, from your setup file.
|
|
86
94
|
*
|
|
@@ -93,4 +101,4 @@ declare global {
|
|
|
93
101
|
*/
|
|
94
102
|
declare function registerSignalMatchers(): void;
|
|
95
103
|
|
|
96
|
-
export { type ResourceLike, type SignalLike, registerDirectiveMatchers, registerResourceMatchers, registerSignalMatchers };
|
|
104
|
+
export { type ResourceLike, type SignalLike, type SignalValueOptions, registerDirectiveMatchers, registerResourceMatchers, registerSignalMatchers };
|
package/dist/angular-matchers.js
CHANGED
|
@@ -102,17 +102,18 @@ function diagnose(directive, selector, root, withDirective) {
|
|
|
102
102
|
const elements = selector === void 0 ? [] : matching(root, By.css(selector));
|
|
103
103
|
const where = selector === void 0 ? "" : ` on '${selector}'`;
|
|
104
104
|
const prefix = `[vitest-auto-spy] expected ${name} to be applied${where}`;
|
|
105
|
-
if (selector !== void 0 &&
|
|
105
|
+
if (selector !== void 0 && withDirective.some(isAnchor)) {
|
|
106
|
+
const unrendered = elements.length === 0 ? ", and the element that selector names exists only in a view the directive chose to render" : "";
|
|
106
107
|
return withDocs(
|
|
107
|
-
`${prefix}, but
|
|
108
|
-
|
|
108
|
+
`${prefix}, but it is on a template anchor, not on an element \u2014 a structural directive sits on the comment Angular leaves in place of its template${unrendered}.
|
|
109
|
+
Assert it without a selector: expect(fixture).toHaveDirectiveApplied(${name}).`,
|
|
109
110
|
angularDirectiveApplied
|
|
110
111
|
);
|
|
111
112
|
}
|
|
112
|
-
if (selector !== void 0 &&
|
|
113
|
+
if (selector !== void 0 && elements.length === 0) {
|
|
113
114
|
return withDocs(
|
|
114
|
-
`${prefix}, but
|
|
115
|
-
|
|
115
|
+
`${prefix}, but no element matches that selector.
|
|
116
|
+
Run fixture.detectChanges() before asserting, and check the selector against the template.`,
|
|
116
117
|
angularDirectiveApplied
|
|
117
118
|
);
|
|
118
119
|
}
|
|
@@ -242,9 +243,15 @@ function registerResourceMatchers() {
|
|
|
242
243
|
function isSpy(received) {
|
|
243
244
|
return "mock" in received || "calls" in received;
|
|
244
245
|
}
|
|
246
|
+
function sameClass(a, b) {
|
|
247
|
+
if (typeof a !== "object" || typeof b !== "object" || a === null || b === null || Array.isArray(a) && Array.isArray(b)) {
|
|
248
|
+
return void 0;
|
|
249
|
+
}
|
|
250
|
+
return Object.getPrototypeOf(a) === Object.getPrototypeOf(b) ? void 0 : false;
|
|
251
|
+
}
|
|
245
252
|
function registerSignalMatchers() {
|
|
246
253
|
expect.extend({
|
|
247
|
-
toHaveSignalValue(received, expected) {
|
|
254
|
+
toHaveSignalValue(received, expected, { strict = false } = {}) {
|
|
248
255
|
if (typeof received !== "function") {
|
|
249
256
|
throw new Error(`expected a signal (a zero-argument getter), received ${this.utils.printReceived(received)}`);
|
|
250
257
|
}
|
|
@@ -254,12 +261,12 @@ function registerSignalMatchers() {
|
|
|
254
261
|
);
|
|
255
262
|
}
|
|
256
263
|
const actual = received();
|
|
257
|
-
const pass = this.equals(actual, expected);
|
|
264
|
+
const pass = strict ? this.equals(actual, expected, [...this.customTesters, sameClass], true) : this.equals(actual, expected);
|
|
258
265
|
return {
|
|
259
266
|
pass,
|
|
260
267
|
actual,
|
|
261
268
|
expected,
|
|
262
|
-
message: () => `expected signal ${pass ? "not " : ""}to have value ${this.utils.printExpected(expected)}, got ${this.utils.printReceived(actual)}`
|
|
269
|
+
message: () => `expected signal ${pass ? "not " : ""}to have ${strict ? "strictly equal " : ""}value ${this.utils.printExpected(expected)}, got ${this.utils.printReceived(actual)}`
|
|
263
270
|
};
|
|
264
271
|
}
|
|
265
272
|
});
|
package/dist/angular-router.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Type, Injector, FactoryProvider, Provider } from '@angular/core';
|
|
2
2
|
import { Params, Data, UrlSegment, ActivatedRoute, Route, ResolveData, Navigation, Router, Event } from '@angular/router';
|
|
3
|
-
import { h as AddSpyMethodsByReturnTypes } from './types-
|
|
3
|
+
import { h as AddSpyMethodsByReturnTypes } from './types-CaGn5uvo.js';
|
|
4
4
|
import { SpyLocation } from '@angular/common/testing';
|
|
5
5
|
import 'vitest';
|
|
6
6
|
|
|
@@ -40,7 +40,7 @@ interface ActivatedRouteChange {
|
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* `ActivatedRoute.resources` where the installed `@angular/router` has it (22.2 on), `never` before —
|
|
43
|
-
* so the init key
|
|
43
|
+
* so on 20 through 22.1 the init key cannot be passed.
|
|
44
44
|
*/
|
|
45
45
|
type RouteResources = NonNullable<ActivatedRoute[Extract<'resources', keyof ActivatedRoute>]>;
|
|
46
46
|
/** The route a spec starts from: what a navigation moves, plus what stays fixed for the route's life. */
|
package/dist/angular.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { u as AngularTokenProvider, A as AngularValueProvider, a as AutoSpiedInstance, C as ComponentInputs, b as CreateWithAutoSpiesOptions, E as ElementConstructor, N as NativeElementHolder, R as RenderShallowOptions, c as ResourceStatusLike, d as RunCounter, S as SettleResourceOptions, e as ShallowRender, f as SpyRegistry, g as StableOptions, h as createWithAutoSpies, i as flushEffects, j as hostElement, k as injectSpy, p as provideAutoSpy, v as provideAutoSpyForToken, q as queryElement, r as renderShallow, l as runEffect, s as setInputs, m as settleResource, n as stable, t as trackEffectRuns, o as trackRecomputations } from './track-signal-runs-
|
|
2
|
-
import { o as DeepPartial, C as ClassType, m as ClassSpyConfiguration, S as Spy, s as OnlyMethodKeysOf, h as AddSpyMethodsByReturnTypes, r as NotAPublicKey } from './types-
|
|
3
|
-
export { H as SubjectOf } from './types-
|
|
1
|
+
export { u as AngularTokenProvider, A as AngularValueProvider, a as AutoSpiedInstance, C as ComponentInputs, b as CreateWithAutoSpiesOptions, E as ElementConstructor, N as NativeElementHolder, R as RenderShallowOptions, c as ResourceStatusLike, d as RunCounter, S as SettleResourceOptions, e as ShallowRender, f as SpyRegistry, g as StableOptions, h as createWithAutoSpies, i as flushEffects, j as hostElement, k as injectSpy, p as provideAutoSpy, v as provideAutoSpyForToken, q as queryElement, r as renderShallow, l as runEffect, s as setInputs, m as settleResource, n as stable, t as trackEffectRuns, o as trackRecomputations } from './track-signal-runs-B3noexlc.js';
|
|
2
|
+
import { o as DeepPartial, C as ClassType, m as ClassSpyConfiguration, S as Spy, s as OnlyMethodKeysOf, h as AddSpyMethodsByReturnTypes, r as NotAPublicKey } from './types-CaGn5uvo.js';
|
|
3
|
+
export { H as SubjectOf } from './types-CaGn5uvo.js';
|
|
4
4
|
import { InjectionToken, Provider, Type, WritableSignal, Signal } from '@angular/core';
|
|
5
|
-
import { A as AutoMockConfiguration, D as DeepReadonly } from './expect-emission-
|
|
6
|
-
export { C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, s as setEmissionTimeout } from './expect-emission-
|
|
5
|
+
import { A as AutoMockConfiguration, D as DeepReadonly } from './expect-emission-D7DaPI5H.js';
|
|
6
|
+
export { C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, s as setEmissionTimeout } from './expect-emission-D7DaPI5H.js';
|
|
7
7
|
import { TestAPI } from 'vitest';
|
|
8
|
-
export { I as InjectionLog, T as TrackInjectionsOptions, a as TrackedProvider, t as trackInjections } from './track-injections-
|
|
9
|
-
export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, e as restoreMockedProps } from './prop-mock-
|
|
8
|
+
export { I as InjectionLog, T as TrackInjectionsOptions, a as TrackedProvider, t as trackInjections } from './track-injections-CkVuJHr_.js';
|
|
9
|
+
export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, e as restoreMockedProps } from './prop-mock-e7qpfqY1.js';
|
|
10
10
|
import '@angular/core/testing';
|
|
11
11
|
|
|
12
12
|
/**
|
package/dist/angular.js
CHANGED
|
@@ -462,7 +462,7 @@ function trackInjections(tokens, options = {}) {
|
|
|
462
462
|
return {
|
|
463
463
|
providers,
|
|
464
464
|
injectedTokens: () => [...injected],
|
|
465
|
-
names: () => injected.map(tokenName),
|
|
465
|
+
names: ({ clean = false } = {}) => injected.map(clean ? messageName : tokenName),
|
|
466
466
|
wasInjected: (token) => injected.includes(token),
|
|
467
467
|
get: (token) => {
|
|
468
468
|
if (!doubles.has(token)) {
|
package/dist/bun-angular.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, h as AddSpyMethodsByReturnTypes, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, m as ClassSpyConfiguration, C as ClassType, n as CompleteValueConfig, D as DeepMockProxy, o as DeepPartial, E as ErrorValueConfig, F as Func, p as FunctionSpy, I as InstanceSpyConfiguration, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, s as OnlyMethodKeysOf, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, S as Spy, y as SpyDisposable, z as SpyOptions, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-
|
|
1
|
+
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, h as AddSpyMethodsByReturnTypes, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, m as ClassSpyConfiguration, C as ClassType, n as CompleteValueConfig, D as DeepMockProxy, o as DeepPartial, E as ErrorValueConfig, F as Func, p as FunctionSpy, I as InstanceSpyConfiguration, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, s as OnlyMethodKeysOf, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, S as Spy, y as SpyDisposable, z as SpyOptions, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-CaGn5uvo.js';
|
|
2
2
|
export { AdoptMockOptions, AdoptedMock, ArgCaptor, AsInstances, AssertMockedOptions, CallLog, CaptureArgOptions, ConstructorMock, ConstructorSpy, FixtureFactory, FlushUntilOptions, MockDeepOptions, ModuleNamespace, ModuleNamespaceOptions, SpyClassOptions, adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, clearAutoSpy, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromClass, createSpyFromInstance, errorHandler, flushEventLoop, flushEventLoopUntil, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, resetAutoSpy, restoreSpiedInstance, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './bun.js';
|
|
3
|
-
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-
|
|
4
|
-
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-
|
|
5
|
-
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-
|
|
6
|
-
export { A as AngularValueProvider, a as AutoSpiedInstance, C as ComponentInputs, b as CreateWithAutoSpiesOptions, E as ElementConstructor, N as NativeElementHolder, R as RenderShallowOptions, c as ResourceStatusLike, d as RunCounter, S as SettleResourceOptions, e as ShallowRender, f as SpyRegistry, g as StableOptions, h as createWithAutoSpies, i as flushEffects, j as hostElement, k as injectSpy, p as provideAutoSpy, q as queryElement, r as renderShallow, l as runEffect, s as setInputs, m as settleResource, n as stable, t as trackEffectRuns, o as trackRecomputations } from './track-signal-runs-
|
|
3
|
+
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-D7DaPI5H.js';
|
|
4
|
+
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-C362z4w-.js';
|
|
5
|
+
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-e7qpfqY1.js';
|
|
6
|
+
export { A as AngularValueProvider, a as AutoSpiedInstance, C as ComponentInputs, b as CreateWithAutoSpiesOptions, E as ElementConstructor, N as NativeElementHolder, R as RenderShallowOptions, c as ResourceStatusLike, d as RunCounter, S as SettleResourceOptions, e as ShallowRender, f as SpyRegistry, g as StableOptions, h as createWithAutoSpies, i as flushEffects, j as hostElement, k as injectSpy, p as provideAutoSpy, q as queryElement, r as renderShallow, l as runEffect, s as setInputs, m as settleResource, n as stable, t as trackEffectRuns, o as trackRecomputations } from './track-signal-runs-B3noexlc.js';
|
|
7
7
|
import 'vitest';
|
|
8
8
|
import '@angular/core';
|
|
9
9
|
import '@angular/core/testing';
|
package/dist/bun-angular.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createSpyForToken } from './chunk-
|
|
1
|
+
import { createSpyForToken } from './chunk-XXAGPAZR.js';
|
|
2
2
|
export { injectSpy, provideAutoSpy } from './chunk-MHN6GMXP.js';
|
|
3
3
|
import { stable, flushEffects } from './chunk-UH3KWLVL.js';
|
|
4
4
|
export { flushEffects, stable } from './chunk-UH3KWLVL.js';
|
package/dist/bun.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { z as SpyOptions, C as ClassType, m as ClassSpyConfiguration, s as OnlyMethodKeysOf, S as Spy, I as InstanceSpyConfiguration, o as DeepPartial, D as DeepMockProxy, F as Func, h as AddSpyMethodsByReturnTypes } from './types-
|
|
2
|
-
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, n as CompleteValueConfig, E as ErrorValueConfig, p as FunctionSpy, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, y as SpyDisposable, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-
|
|
3
|
-
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-
|
|
4
|
-
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-
|
|
5
|
-
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-
|
|
1
|
+
import { z as SpyOptions, C as ClassType, m as ClassSpyConfiguration, s as OnlyMethodKeysOf, S as Spy, I as InstanceSpyConfiguration, o as DeepPartial, D as DeepMockProxy, F as Func, h as AddSpyMethodsByReturnTypes } from './types-CaGn5uvo.js';
|
|
2
|
+
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, n as CompleteValueConfig, E as ErrorValueConfig, p as FunctionSpy, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, y as SpyDisposable, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-CaGn5uvo.js';
|
|
3
|
+
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-D7DaPI5H.js';
|
|
4
|
+
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-C362z4w-.js';
|
|
5
|
+
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-e7qpfqY1.js';
|
|
6
6
|
import { Mock, MockInstance } from 'vitest';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -31,7 +31,7 @@ function trackInjections(tokens, options = {}) {
|
|
|
31
31
|
return {
|
|
32
32
|
providers,
|
|
33
33
|
injectedTokens: () => [...injected],
|
|
34
|
-
names: () => injected.map(tokenName),
|
|
34
|
+
names: ({ clean = false } = {}) => injected.map(clean ? messageName : tokenName),
|
|
35
35
|
wasInjected: (token) => injected.includes(token),
|
|
36
36
|
get: (token) => {
|
|
37
37
|
if (!doubles.has(token)) {
|
package/dist/cli.js
CHANGED
|
@@ -3593,7 +3593,8 @@ function istanbulBecause(profile, { config, keys, browsers }) {
|
|
|
3593
3593
|
return istanbul && !v8 ? "only `@vitest/coverage-istanbul` is installed, so the builder picks istanbul" : void 0;
|
|
3594
3594
|
}
|
|
3595
3595
|
var hasModuleCache = ({ keys }) => keys.some((key) => isKey(key, "fsModuleCache") && isTrue(key));
|
|
3596
|
-
var ISTANBUL_MEASURED = "
|
|
3596
|
+
var ISTANBUL_MEASURED = "The module cache took an istanbul coverage run under the builder from 24.55 s to 13.20 s (up to \u221246 %) on an Angular 22.2 suite of 700 spec files on Vitest 5, and from 27.01 s to 15.85 s (\u221241 %) with the builder cache off, as it is on CI; on an 862-spec suite it took 48 s to 39 s (\u221219 %). Switching that suite to v8 beat istanbul with the cache about 2x: 19\u201322 s, where the cache gained nothing, since the builder has already bundled the code. The cache pays off on CI only when CI keeps `node_modules/.vitest-cache` between runs.";
|
|
3597
|
+
var V8_INSTEAD = " Or switch the target to `coverage.provider: 'v8'`, with `@vitest/coverage-v8` installed: it needs no cache, and the coverage thresholds are worth one run to confirm after the switch.";
|
|
3597
3598
|
function moduleCacheFinding(profile, { first, why, targets: group3 }) {
|
|
3598
3599
|
const where2 = namedTargets(group3.map(({ target }) => target));
|
|
3599
3600
|
const ci = ciConfigs(profile);
|
|
@@ -3604,7 +3605,7 @@ function moduleCacheFinding(profile, { first, why, targets: group3 }) {
|
|
|
3604
3605
|
severity: "info",
|
|
3605
3606
|
file: first.config ?? first.target.file,
|
|
3606
3607
|
message: `${where2} collects coverage with istanbul through \`${first.target.builder}\` (${why}), and no runner config of it turns on \`fsModuleCache\`: every run instruments every file again. ${ISTANBUL_MEASURED}`,
|
|
3607
|
-
fix: `${turnOn}${persist}`
|
|
3608
|
+
fix: `${turnOn}${persist}${V8_INSTEAD}`
|
|
3608
3609
|
};
|
|
3609
3610
|
}
|
|
3610
3611
|
function checkIstanbulModuleCache(profile, targets) {
|
|
@@ -3862,7 +3863,7 @@ function checkForeignPragma(graph) {
|
|
|
3862
3863
|
}
|
|
3863
3864
|
|
|
3864
3865
|
// src/cli/checks/export-map.generated.ts
|
|
3865
|
-
var EXPORT_MAP_VERSION = "5.
|
|
3866
|
+
var EXPORT_MAP_VERSION = "5.42.0";
|
|
3866
3867
|
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";
|
|
3867
3868
|
var EXPORTED_BY = {
|
|
3868
3869
|
AccessorImplementations: "0 1 2 3 4 12 20 21 22",
|
|
@@ -4220,6 +4221,7 @@ var EXPORTED_BY = {
|
|
|
4220
4221
|
setupFakeTimers: "23",
|
|
4221
4222
|
ShallowRender: "2 12",
|
|
4222
4223
|
SignalLike: "15",
|
|
4224
|
+
SignalValueOptions: "15",
|
|
4223
4225
|
SpecTiming: "13",
|
|
4224
4226
|
SpiedFixtures: "12",
|
|
4225
4227
|
Spy: "0 1 2 3 4 9 12 20 21 22",
|
|
@@ -5203,7 +5205,8 @@ Commands
|
|
|
5203
5205
|
does not pass through: a shard, or the specs a change reaches.
|
|
5204
5206
|
Lists the target's specs with --list-tests (@angular/build 21+),
|
|
5205
5207
|
picks the ones this run gets and hands them to the builder as
|
|
5206
|
-
--include paths, so
|
|
5208
|
+
--include paths, so from @angular/build 22.2 it compiles only
|
|
5209
|
+
those. Exits with ng's code.
|
|
5207
5210
|
|
|
5208
5211
|
init Write a pointer to node_modules/vitest-auto-spy/AGENTS.md into the
|
|
5209
5212
|
instruction files the agents in this repository actually read, and
|
package/dist/console.d.ts
CHANGED
package/dist/dom-stubs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as Func } from './types-
|
|
1
|
+
import { F as Func } from './types-CaGn5uvo.js';
|
|
2
2
|
export { W as WebStorageKey, a as WebStorageStub, b as WebStorageStubOptions, s as stubWebStorage } from './web-storage-dwQ9E7Lm.js';
|
|
3
|
-
import { R as RestoreProp } from './prop-mock-
|
|
3
|
+
import { R as RestoreProp } from './prop-mock-e7qpfqY1.js';
|
|
4
4
|
import 'vitest';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as StrictSpyConfiguration, t as OnlyObservablePropsOf, M as MethodReturns, s as OnlyMethodKeysOf, S as Spy, o as DeepPartial, z as SpyOptions, C as ClassType, m as ClassSpyConfiguration } from './types-
|
|
1
|
+
import { B as StrictSpyConfiguration, t as OnlyObservablePropsOf, M as MethodReturns, s as OnlyMethodKeysOf, S as Spy, o as DeepPartial, z as SpyOptions, C as ClassType, m as ClassSpyConfiguration } from './types-CaGn5uvo.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Create a fully-typed auto-mock of `T` from its type alone (no class).
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, h as AddSpyMethodsByReturnTypes, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, m as ClassSpyConfiguration, C as ClassType, n as CompleteValueConfig, D as DeepMockProxy, o as DeepPartial, E as ErrorValueConfig, F as Func, p as FunctionSpy, I as InstanceSpyConfiguration, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, s as OnlyMethodKeysOf, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, S as Spy, y as SpyDisposable, z as SpyOptions, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-
|
|
1
|
+
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, h as AddSpyMethodsByReturnTypes, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, m as ClassSpyConfiguration, C as ClassType, n as CompleteValueConfig, D as DeepMockProxy, o as DeepPartial, E as ErrorValueConfig, F as Func, p as FunctionSpy, I as InstanceSpyConfiguration, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, s as OnlyMethodKeysOf, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, S as Spy, y as SpyDisposable, z as SpyOptions, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-CaGn5uvo.js';
|
|
2
2
|
export { AdoptMockOptions, AdoptedMock, ArgCaptor, AsInstances, AssertMockedOptions, CallLog, CaptureArgOptions, ConstructorMock, ConstructorSpy, FixtureFactory, FlushUntilOptions, MockDeepOptions, ModuleNamespace, ModuleNamespaceOptions, SpyClassOptions, adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, clearAutoSpy, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromClass, createSpyFromInstance, errorHandler, flushEventLoop, flushEventLoopUntil, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, resetAutoSpy, restoreSpiedInstance, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './bun.js';
|
|
3
|
-
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-
|
|
4
|
-
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-
|
|
5
|
-
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-
|
|
3
|
+
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-D7DaPI5H.js';
|
|
4
|
+
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-C362z4w-.js';
|
|
5
|
+
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-e7qpfqY1.js';
|
|
6
6
|
import 'vitest';
|
package/dist/jasmine-compat.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Mock } from 'vitest';
|
|
2
|
-
import { F as Func, h as AddSpyMethodsByReturnTypes, g as AddPromiseSpyMethods, O as ObservableLike, f as AddObservableSpyMethods, y as SpyDisposable } from './types-
|
|
2
|
+
import { F as Func, h as AddSpyMethodsByReturnTypes, g as AddPromiseSpyMethods, O as ObservableLike, f as AddObservableSpyMethods, y as SpyDisposable } from './types-CaGn5uvo.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Install the `.and`, `.calls` and `.withArgs` namespaces on every spy built afterwards.
|
package/dist/jasmine.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JasmineSpy, JasmineMethodSpy } from './jasmine-compat.js';
|
|
2
2
|
export { JasmineAccessorSpies, JasmineAccessorSpy, JasmineAnd, JasmineCallInfo, JasmineCalls, JasmineNamespaces, JasmineStrategies, JasmineWithArgsAnd, JasmineWithArgsSync, enableJasmineCompat } from './jasmine-compat.js';
|
|
3
|
-
import { C as ClassType, m as ClassSpyConfiguration, s as OnlyMethodKeysOf, F as Func } from './types-
|
|
4
|
-
export { t as OnlyObservablePropsOf, u as OnlyPropsOf } from './types-
|
|
3
|
+
import { C as ClassType, m as ClassSpyConfiguration, s as OnlyMethodKeysOf, F as Func } from './types-CaGn5uvo.js';
|
|
4
|
+
export { t as OnlyObservablePropsOf, u as OnlyPropsOf } from './types-CaGn5uvo.js';
|
|
5
5
|
import { expect } from 'vitest';
|
|
6
6
|
|
|
7
7
|
/**
|
package/dist/nestjs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ClassType, S as Spy, m as ClassSpyConfiguration, s as OnlyMethodKeysOf } from './types-
|
|
2
|
-
export { I as InjectionLog, T as TrackInjectionsOptions, a as TrackedProvider, t as trackInjections } from './track-injections-
|
|
1
|
+
import { C as ClassType, S as Spy, m as ClassSpyConfiguration, s as OnlyMethodKeysOf } from './types-CaGn5uvo.js';
|
|
2
|
+
export { I as InjectionLog, T as TrackInjectionsOptions, a as TrackedProvider, t as trackInjections } from './track-injections-CkVuJHr_.js';
|
|
3
3
|
import 'vitest';
|
|
4
4
|
|
|
5
5
|
/** `{ provide, useValue }` shape consumed by NestJS's `providers`. */
|
package/dist/nestjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createSpyForToken } from './chunk-
|
|
2
|
-
export { trackInjections } from './chunk-
|
|
1
|
+
import { createSpyForToken } from './chunk-XXAGPAZR.js';
|
|
2
|
+
export { trackInjections } from './chunk-XXAGPAZR.js';
|
|
3
3
|
import { createSpyFromClass } from './chunk-EYXARTWD.js';
|
|
4
4
|
import { useVitestAdapter } from './chunk-J4IJCTHT.js';
|
|
5
5
|
import './chunk-J2C3KRTC.js';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, h as AddSpyMethodsByReturnTypes, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, m as ClassSpyConfiguration, C as ClassType, n as CompleteValueConfig, D as DeepMockProxy, o as DeepPartial, E as ErrorValueConfig, F as Func, p as FunctionSpy, I as InstanceSpyConfiguration, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, s as OnlyMethodKeysOf, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, S as Spy, y as SpyDisposable, z as SpyOptions, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-
|
|
1
|
+
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, h as AddSpyMethodsByReturnTypes, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, m as ClassSpyConfiguration, C as ClassType, n as CompleteValueConfig, D as DeepMockProxy, o as DeepPartial, E as ErrorValueConfig, F as Func, p as FunctionSpy, I as InstanceSpyConfiguration, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, s as OnlyMethodKeysOf, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, S as Spy, y as SpyDisposable, z as SpyOptions, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-CaGn5uvo.js';
|
|
2
2
|
export { AdoptMockOptions, AdoptedMock, ArgCaptor, AsInstances, AssertMockedOptions, CallLog, CaptureArgOptions, ConstructorMock, ConstructorSpy, FixtureFactory, FlushUntilOptions, MockDeepOptions, ModuleNamespace, ModuleNamespaceOptions, SpyClassOptions, adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, clearAutoSpy, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromClass, createSpyFromInstance, errorHandler, flushEventLoop, flushEventLoopUntil, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, resetAutoSpy, restoreSpiedInstance, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './bun.js';
|
|
3
|
-
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-
|
|
4
|
-
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-
|
|
5
|
-
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-
|
|
3
|
+
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-D7DaPI5H.js';
|
|
4
|
+
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-C362z4w-.js';
|
|
5
|
+
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-e7qpfqY1.js';
|
|
6
6
|
import 'vitest';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as UnstubbedCallHandler, F as Func, h as AddSpyMethodsByReturnTypes } from './types-
|
|
1
|
+
import { J as UnstubbedCallHandler, F as Func, h as AddSpyMethodsByReturnTypes } from './types-CaGn5uvo.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A spy's strict-mode guard: who owns it, and what to do about a call nobody configured.
|
package/dist/react.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, h as AddSpyMethodsByReturnTypes, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, m as ClassSpyConfiguration, C as ClassType, n as CompleteValueConfig, D as DeepMockProxy, o as DeepPartial, E as ErrorValueConfig, F as Func, p as FunctionSpy, I as InstanceSpyConfiguration, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, s as OnlyMethodKeysOf, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, S as Spy, y as SpyDisposable, z as SpyOptions, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-
|
|
1
|
+
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, h as AddSpyMethodsByReturnTypes, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, m as ClassSpyConfiguration, C as ClassType, n as CompleteValueConfig, D as DeepMockProxy, o as DeepPartial, E as ErrorValueConfig, F as Func, p as FunctionSpy, I as InstanceSpyConfiguration, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, s as OnlyMethodKeysOf, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, S as Spy, y as SpyDisposable, z as SpyOptions, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-CaGn5uvo.js';
|
|
2
2
|
export { AdoptMockOptions, AdoptedMock, ArgCaptor, AsInstances, AssertMockedOptions, CallLog, CaptureArgOptions, ConstructorMock, ConstructorSpy, FixtureFactory, FlushUntilOptions, MockDeepOptions, ModuleNamespace, ModuleNamespaceOptions, SpyClassOptions, adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, clearAutoSpy, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromClass, createSpyFromInstance, errorHandler, flushEventLoop, flushEventLoopUntil, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, resetAutoSpy, restoreSpiedInstance, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './bun.js';
|
|
3
|
-
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-
|
|
4
|
-
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-
|
|
5
|
-
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-
|
|
3
|
+
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-D7DaPI5H.js';
|
|
4
|
+
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-C362z4w-.js';
|
|
5
|
+
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-e7qpfqY1.js';
|
|
6
6
|
import 'vitest';
|
package/dist/rstest.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, h as AddSpyMethodsByReturnTypes, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, m as ClassSpyConfiguration, C as ClassType, n as CompleteValueConfig, D as DeepMockProxy, o as DeepPartial, E as ErrorValueConfig, F as Func, p as FunctionSpy, I as InstanceSpyConfiguration, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, s as OnlyMethodKeysOf, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, S as Spy, y as SpyDisposable, z as SpyOptions, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-
|
|
1
|
+
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, h as AddSpyMethodsByReturnTypes, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, m as ClassSpyConfiguration, C as ClassType, n as CompleteValueConfig, D as DeepMockProxy, o as DeepPartial, E as ErrorValueConfig, F as Func, p as FunctionSpy, I as InstanceSpyConfiguration, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, s as OnlyMethodKeysOf, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, S as Spy, y as SpyDisposable, z as SpyOptions, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-CaGn5uvo.js';
|
|
2
2
|
export { AdoptMockOptions, AdoptedMock, ArgCaptor, AsInstances, AssertMockedOptions, CallLog, CaptureArgOptions, ConstructorMock, ConstructorSpy, FixtureFactory, FlushUntilOptions, MockDeepOptions, ModuleNamespace, ModuleNamespaceOptions, SpyClassOptions, adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, clearAutoSpy, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromClass, createSpyFromInstance, errorHandler, flushEventLoop, flushEventLoopUntil, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, resetAutoSpy, restoreSpiedInstance, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './bun.js';
|
|
3
|
-
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-
|
|
4
|
-
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-
|
|
5
|
-
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-
|
|
3
|
+
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-D7DaPI5H.js';
|
|
4
|
+
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-C362z4w-.js';
|
|
5
|
+
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-e7qpfqY1.js';
|
|
6
6
|
import 'vitest';
|
package/dist/rxjs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Observable, ReplaySubject, Subject } from 'rxjs';
|
|
2
|
-
import { V as ValueConfig } from './types-
|
|
3
|
-
export { f as AddObservableSpyMethods, n as CompleteValueConfig, E as ErrorValueConfig, N as NextValueConfig, Q as ValueConfigPerCall } from './types-
|
|
2
|
+
import { V as ValueConfig } from './types-CaGn5uvo.js';
|
|
3
|
+
export { f as AddObservableSpyMethods, n as CompleteValueConfig, E as ErrorValueConfig, N as NextValueConfig, Q as ValueConfigPerCall } from './types-CaGn5uvo.js';
|
|
4
4
|
import 'vitest';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/setup.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { vi } from 'vitest';
|
|
2
|
-
import { O as OutsideHookReaction, R as RestoreProp } from './prop-mock-
|
|
3
|
-
import { J as UnstubbedCallHandler, L as UnstubbedReadHandler } from './types-
|
|
4
|
-
export { d as describeDuplicateCopies, g as getPackageCopies, t as takeStrictViolations } from './package-identity-
|
|
2
|
+
import { O as OutsideHookReaction, R as RestoreProp } from './prop-mock-e7qpfqY1.js';
|
|
3
|
+
import { J as UnstubbedCallHandler, L as UnstubbedReadHandler } from './types-CaGn5uvo.js';
|
|
4
|
+
export { d as describeDuplicateCopies, g as getPackageCopies, t as takeStrictViolations } from './package-identity-C362z4w-.js';
|
|
5
5
|
export { R as RestoreWebStorageOptions, r as restoreWebStorage } from './web-storage-dwQ9E7Lm.js';
|
|
6
6
|
|
|
7
7
|
/** How a per-test guard reacts to what it found: fail the test, only report it, or not run at all. */
|
package/dist/svelte.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, h as AddSpyMethodsByReturnTypes, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, m as ClassSpyConfiguration, C as ClassType, n as CompleteValueConfig, D as DeepMockProxy, o as DeepPartial, E as ErrorValueConfig, F as Func, p as FunctionSpy, I as InstanceSpyConfiguration, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, s as OnlyMethodKeysOf, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, S as Spy, y as SpyDisposable, z as SpyOptions, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-
|
|
1
|
+
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, h as AddSpyMethodsByReturnTypes, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, m as ClassSpyConfiguration, C as ClassType, n as CompleteValueConfig, D as DeepMockProxy, o as DeepPartial, E as ErrorValueConfig, F as Func, p as FunctionSpy, I as InstanceSpyConfiguration, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, s as OnlyMethodKeysOf, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, S as Spy, y as SpyDisposable, z as SpyOptions, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-CaGn5uvo.js';
|
|
2
2
|
export { AdoptMockOptions, AdoptedMock, ArgCaptor, AsInstances, AssertMockedOptions, CallLog, CaptureArgOptions, ConstructorMock, ConstructorSpy, FixtureFactory, FlushUntilOptions, MockDeepOptions, ModuleNamespace, ModuleNamespaceOptions, SpyClassOptions, adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, clearAutoSpy, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromClass, createSpyFromInstance, errorHandler, flushEventLoop, flushEventLoopUntil, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, resetAutoSpy, restoreSpiedInstance, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './bun.js';
|
|
3
|
-
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-
|
|
4
|
-
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-
|
|
5
|
-
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-
|
|
3
|
+
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-D7DaPI5H.js';
|
|
4
|
+
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-C362z4w-.js';
|
|
5
|
+
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-e7qpfqY1.js';
|
|
6
6
|
import 'vitest';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ClassType, S as Spy } from './types-
|
|
1
|
+
import { C as ClassType, S as Spy } from './types-CaGn5uvo.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The provider shape Angular and NestJS agree on: `{ provide, useFactory }`, with the dependency
|
|
@@ -23,8 +23,14 @@ interface InjectionLog {
|
|
|
23
23
|
readonly providers: TrackedProvider[];
|
|
24
24
|
/** The tokens DI asked for, in the order their factories ran. A copy — mutating it changes nothing. */
|
|
25
25
|
injectedTokens(): unknown[];
|
|
26
|
-
/**
|
|
27
|
-
|
|
26
|
+
/**
|
|
27
|
+
* The same list as names, which is what makes a failing `toEqual` readable. Each is the token's own
|
|
28
|
+
* `name`, so esbuild's `_Service` stays as it is; `{ clean: true }` takes a bundler's rename off,
|
|
29
|
+
* the way every failure message prints it.
|
|
30
|
+
*/
|
|
31
|
+
names(options?: {
|
|
32
|
+
readonly clean?: boolean;
|
|
33
|
+
}): string[];
|
|
28
34
|
/** Whether DI ever constructed `token`. */
|
|
29
35
|
wasInjected(token: unknown): boolean;
|
|
30
36
|
/** The double registered for `token`, typed as a spy. Throws when the token was never tracked. */
|
|
@@ -44,7 +50,7 @@ interface InjectionLog {
|
|
|
44
50
|
*
|
|
45
51
|
* TestBed.inject(CheckoutFacade).start();
|
|
46
52
|
*
|
|
47
|
-
* expect(collaborators.names()).toEqual(['FeatureFlagService']); // analytics was never asked for
|
|
53
|
+
* expect(collaborators.names({ clean: true })).toEqual(['FeatureFlagService']); // analytics was never asked for
|
|
48
54
|
* ```
|
|
49
55
|
*
|
|
50
56
|
* The doubles are built up front, so a spec can stub one before the entry point runs; the *record*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InjectionToken, Injector, ProviderToken, Provider, Type, InputSignalWithTransform, InputSignal, ModelSignal, EnvironmentProviders, EffectRef, Signal } from '@angular/core';
|
|
2
|
-
import { A as AutoMockConfiguration } from './expect-emission-
|
|
3
|
-
import { S as Spy, C as ClassType, z as SpyOptions, m as ClassSpyConfiguration, s as OnlyMethodKeysOf, o as DeepPartial } from './types-
|
|
4
|
-
import './prop-mock-
|
|
2
|
+
import { A as AutoMockConfiguration } from './expect-emission-D7DaPI5H.js';
|
|
3
|
+
import { S as Spy, C as ClassType, z as SpyOptions, m as ClassSpyConfiguration, s as OnlyMethodKeysOf, o as DeepPartial } from './types-CaGn5uvo.js';
|
|
4
|
+
import './prop-mock-e7qpfqY1.js';
|
|
5
5
|
import { ComponentFixture } from '@angular/core/testing';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -952,7 +952,8 @@ interface ClassSpyConfiguration<T> extends StrictSpyConfiguration {
|
|
|
952
952
|
* and defines nothing until a method is read. The accessor path's first read drops the double into a
|
|
953
953
|
* property dictionary as wide as the class; the proxy never does, so at 8–16 methods it is ~1.4 kB
|
|
954
954
|
* against ~2.1 kB with one method called, and at 45 methods ~1.4 kB against ~4.4 kB, built 2–6×
|
|
955
|
-
* faster.
|
|
955
|
+
* faster. The width is the number of methods the double spies, after `onlyMethodsToSpyOn` narrows
|
|
956
|
+
* it and `methodsToSpyOn` / `instanceMethodsToSpyOn` add to it.
|
|
956
957
|
*
|
|
957
958
|
* What a wide class's proxy double changes, and the reason to pass `lazySpies: true`: every read of
|
|
958
959
|
* a member pays a trap (~20 ns); `util.types.isProxy` is `true`; `console.log` shows only the
|
package/dist/vue.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { S as Spy, C as ClassType, m as ClassSpyConfiguration, s as OnlyMethodKeysOf } from './types-
|
|
2
|
-
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, h as AddSpyMethodsByReturnTypes, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, n as CompleteValueConfig, D as DeepMockProxy, o as DeepPartial, E as ErrorValueConfig, F as Func, p as FunctionSpy, I as InstanceSpyConfiguration, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, y as SpyDisposable, z as SpyOptions, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-
|
|
1
|
+
import { S as Spy, C as ClassType, m as ClassSpyConfiguration, s as OnlyMethodKeysOf } from './types-CaGn5uvo.js';
|
|
2
|
+
export { A as AccessorKeysOf, a as AddAccessorsSpies, b as AddCalledWithAny, c as AddCalledWithObservable, d as AddCalledWithPromise, e as AddCalledWithSpyMethods, f as AddObservableSpyMethods, g as AddPromiseSpyMethods, h as AddSpyMethodsByReturnTypes, i as AddThrowHelper, j as AddVoidReturnHelpers, k as AnyReturnHelpers, l as AutoSpyRxjsTypes, n as CompleteValueConfig, D as DeepMockProxy, o as DeepPartial, E as ErrorValueConfig, F as Func, p as FunctionSpy, I as InstanceSpyConfiguration, M as MethodReturns, q as Mutable, N as NextValueConfig, r as NotAPublicKey, O as ObservableLike, t as OnlyObservablePropsOf, u as OnlyPropsOf, v as Overload, w as OverloadChoice, x as Overloads, P as PropStubValue, y as SpyDisposable, z as SpyOptions, B as StrictSpyConfiguration, G as SubjectLike, H as SubjectOf, U as UnstubbedCall, J as UnstubbedCallHandler, K as UnstubbedRead, L as UnstubbedReadHandler, V as ValueConfig, Q as ValueConfigPerCall, W as WithMockReturnValue } from './types-CaGn5uvo.js';
|
|
3
3
|
export { AdoptMockOptions, AdoptedMock, ArgCaptor, AsInstances, AssertMockedOptions, CallLog, CaptureArgOptions, ConstructorMock, ConstructorSpy, FixtureFactory, FlushUntilOptions, MockDeepOptions, ModuleNamespace, ModuleNamespaceOptions, SpyClassOptions, adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, clearAutoSpy, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromClass, createSpyFromInstance, errorHandler, flushEventLoop, flushEventLoopUntil, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, resetAutoSpy, restoreSpiedInstance, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './bun.js';
|
|
4
|
-
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-
|
|
5
|
-
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-
|
|
6
|
-
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-
|
|
4
|
+
export { A as AutoMockConfiguration, a as AutoMocked, b as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, c as EmissionOptions, d as EmissionSource, S as SubscribableLike, e as autoMocked, f as clearAutoSpyDefaults, g as createAutoMock, h as expectAllEmissions, i as expectCompletion, j as expectEmission, k as expectEmissions, l as expectError, m as expectNoEmission, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './expect-emission-D7DaPI5H.js';
|
|
5
|
+
export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-C362z4w-.js';
|
|
6
|
+
export { A as AccessorImplementations, O as OutsideHookReaction, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as reportPropsOutsideHooks, e as restoreMockedProps } from './prop-mock-e7qpfqY1.js';
|
|
7
7
|
import 'vitest';
|
|
8
8
|
|
|
9
9
|
/** A Vue injection token: a plain string/symbol key, or a typed `InjectionKey<T>` (a branded `symbol`). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest-auto-spy",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.43.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",
|
|
@@ -358,7 +358,9 @@ it('loads', async () => {
|
|
|
358
358
|
The family that installs an implementation (`mockImplementation`, `mockReturnValue`,
|
|
359
359
|
`mockReturnThis`, `mockThrow`, `mockResolvedValue`, `mockRejectedValue`) replaces the very dispatch
|
|
360
360
|
a chain is read by, so one of the two silently decides nothing and the spec goes green on a branch
|
|
361
|
-
nobody configured. Both orders are reported (warn, or throw under the `strict` preset)
|
|
361
|
+
nobody configured. Both orders are reported (warn, or throw under the `strict` preset) — except a
|
|
362
|
+
wrapper that delegates: `vi.when(spy)` (Vitest 5), or a `mockImplementation` built from
|
|
363
|
+
`spy.getMockImplementation()`, since the chain still answers every call it passes through. Want a
|
|
362
364
|
fallback **and** a per-argument value? Put the fallback in the container — `returns:` where the
|
|
363
365
|
double is built, or `resolveWith` / `nextWith` / `failWith` — which a `calledWith` still wins over.
|
|
364
366
|
- **`calledWith(x);` on its own is a stub, not an assertion.** It configures "answer `undefined`
|
|
@@ -372,7 +374,8 @@ it('loads', async () => {
|
|
|
372
374
|
it took to stderr, with where the first three were scheduled; `onStrayTimers` receives every one's
|
|
373
375
|
file and frames in `timers` instead of the warning.
|
|
374
376
|
- **Never assert a signal with `toBeTruthy()`** — every signal is truthy. Use
|
|
375
|
-
`toHaveSignalValue(v)` after `registerSignalMatchers()` from `vitest-auto-spy/angular/matchers
|
|
377
|
+
`toHaveSignalValue(v)` after `registerSignalMatchers()` from `vitest-auto-spy/angular/matchers`
|
|
378
|
+
(`toEqual` semantics; `toHaveSignalValue(v, { strict: true })` for `toStrictEqual`'s).
|
|
376
379
|
- **Never assert a resource with `expect(r.value()).toEqual(...)` alone** — an unresolved resource
|
|
377
380
|
still holds its _default_, so that passes while proving nothing. `toHaveResourceValue(v)` after
|
|
378
381
|
`registerResourceMatchers()`, from the same `/angular/matchers` entry, fails unless the resource
|