vitest-auto-spy 5.55.0 → 5.56.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +66 -1
  2. package/README.md +3 -1
  3. package/agent-docs/checklist.md +5 -2
  4. package/agent-docs/configuration.md +1 -0
  5. package/agent-docs/eslint.md +2 -2
  6. package/agent-docs/factories.md +16 -2
  7. package/dist/angular-diagnostics.js +5 -5
  8. package/dist/angular-doubles.d.ts +1 -1
  9. package/dist/angular-doubles.js +7 -7
  10. package/dist/angular-router.d.ts +1 -1
  11. package/dist/angular-router.js +3 -3
  12. package/dist/angular.d.ts +7 -7
  13. package/dist/bun-angular.d.ts +6 -6
  14. package/dist/bun-angular.js +11 -11
  15. package/dist/bun.d.ts +5 -5
  16. package/dist/bun.js +6 -6
  17. package/dist/{chunk-GHKBJN2T.js → chunk-3IINYLDB.js} +4 -4
  18. package/dist/{chunk-M4CUD2XH.js → chunk-3OEYMUV3.js} +1 -1
  19. package/dist/{chunk-ZVF3E6T7.js → chunk-JFROAGGY.js} +1 -1
  20. package/dist/{chunk-OXONPFSL.js → chunk-KHALREYP.js} +3 -3
  21. package/dist/{chunk-UTOPAD66.js → chunk-LKXOKRTC.js} +131 -95
  22. package/dist/{chunk-TIXTHSW4.js → chunk-RAJTKMDV.js} +1 -1
  23. package/dist/{chunk-JMBAECZN.js → chunk-RQLUH6RE.js} +1 -1
  24. package/dist/{chunk-MDWE3FCP.js → chunk-UH2Q7RTQ.js} +1 -1
  25. package/dist/{chunk-HRE4K6N3.js → chunk-XZ5JUXKT.js} +1 -1
  26. package/dist/{chunk-7LZ6V5UO.js → chunk-ZTT2QLMJ.js} +2 -2
  27. package/dist/{cli-SELXGLDQ.js → cli-BLEXQVAS.js} +1 -0
  28. package/dist/{cli-FXW5AFQ5.js → cli-CJ767PUP.js} +1 -1
  29. package/dist/cli.js +389 -77
  30. package/dist/console.d.ts +1 -1
  31. package/dist/console.js +4 -4
  32. package/dist/core.d.ts +5 -5
  33. package/dist/dom-stubs.d.ts +2 -2
  34. package/dist/{emission-sync-xEda8ZCk.d.ts → emission-sync-CNbHIKGX.d.ts} +33 -2
  35. package/dist/eslint-plugin.cjs +143 -40
  36. package/dist/index.d.ts +4 -4
  37. package/dist/index.js +39 -5
  38. package/dist/jasmine-compat.d.ts +1 -1
  39. package/dist/jasmine.d.ts +2 -2
  40. package/dist/jasmine.js +6 -6
  41. package/dist/{nest-unit-Bg6JWPgu.d.ts → nest-unit-DdJ251KZ.d.ts} +1 -1
  42. package/dist/nestjs.d.ts +3 -3
  43. package/dist/nestjs.js +6 -6
  44. package/dist/node.cjs +38 -4
  45. package/dist/node.d.ts +5 -5
  46. package/dist/node.js +38 -4
  47. package/dist/observer-spy.d.ts +1 -1
  48. package/dist/{package-identity-COBYU0WJ.d.ts → package-identity-Dhlx2i2x.d.ts} +1 -1
  49. package/dist/{prop-mock-CE9gNMPY.d.ts → prop-mock-vydpb5c5.d.ts} +1 -1
  50. package/dist/react.d.ts +4 -4
  51. package/dist/rstest.d.ts +4 -4
  52. package/dist/rstest.js +6 -6
  53. package/dist/rxjs.d.ts +3 -3
  54. package/dist/rxjs.js +1 -1
  55. package/dist/setup.d.ts +3 -3
  56. package/dist/svelte.d.ts +4 -4
  57. package/dist/{track-injections-C6zITWXE.d.ts → track-injections-BkGvSEzV.d.ts} +1 -1
  58. package/dist/{track-signal-runs-CM-leczv.d.ts → track-signal-runs-BDQ6MqwO.d.ts} +3 -3
  59. package/dist/{types-qYoxQi5C.d.ts → types-NphKNopY.d.ts} +16 -1
  60. package/dist/vue.d.ts +5 -5
  61. package/package.json +1 -1
  62. package/skills/vitest-auto-spy/SKILL.md +7 -2
  63. package/dist/{chunk-UOKFQQ5H.js → chunk-TXC3L3FO.js} +40 -40
package/CHANGELOG.md CHANGED
@@ -10,6 +10,70 @@ The latest released version here must always match the one published on
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [5.56.0] - 2026-09-30
14
+
15
+ ### Fixed
16
+
17
+ - **`no-real-component-provider` no longer reports a double the spec declares itself.** Under
18
+ `{ childInjectors: true }` a read by position, such as
19
+ `query(By.css('app-footer')).children[0].injector.get(FooterDouble)`, was reported unless the class
20
+ also appeared in `By.directive(…)`. Classes the file declares (`class FooterDouble {}`,
21
+ `const X = class {}`, inside a `describe` too) are now left alone as test doubles; a production
22
+ class they extend is still reported when read.
23
+ - **`no-inline-test-data` no longer counts short tuples or flag bags as repeated data.** An array of
24
+ up to three short numbers, booleans or strings (`[1, 5]`, `['0', '1']`) is a coordinate or an id
25
+ list, and an object of up to three `true`/`false` keys (`{ recursive: true, force: true }`) is an
26
+ options bag; neither is reported as a repeat. `{ from: [1, 1], to: [1, 5] }` written three times
27
+ is now reported once per copy instead of once per tuple. A copy that sits inside a literal already
28
+ reported is no longer reported a second time. On a consumer suite of ~85 specs, 16 of the 37
29
+ reports at the defaults were such tuples.
30
+ - **`no-inline-test-data` no longer asks to move an expected value out of the test.** A long literal
31
+ passed to `toEqual`, `toStrictEqual`, `toMatchObject`, `toHaveBeenCalledWith` and the other
32
+ equality matchers, or to `expect.objectContaining` / `arrayContaining`, is what the test checks:
33
+ the message now asks to keep its shape inline and names the largest part inside it to move, or to
34
+ check fewer entries when it has none.
35
+ - **`shared-env-without-restore` reads the options a setup file really passes.** It used to regex
36
+ the text between the parentheses, so `setupAutoSpy(OPTIONS)` and
37
+ `setupAutoSpy({ ...OPTIONS, blockNetwork: false })` were told every restore switch was off. An
38
+ object declared in the file or imported from another module of the repository now counts, spreads
39
+ apply in order with a later key winning, and a value the check cannot read is never reported as
40
+ off. Each setup file is judged on its own calls and named in its own finding, instead of one call
41
+ anywhere silencing the finding for every setup file; the setup files the runner config lists still
42
+ add up, since they run together.
43
+
44
+ ### Added
45
+
46
+ - **`no-inline-test-data` suggests a spec-local `const` for a literal that reads the spec's own
47
+ names.** A repeated literal that reads or spreads a `const`, `let`, function or parameter the spec
48
+ declares (`['-a', 'Chrome', TARGET]`, `{ ...EMPTY, id: 1 }`) gets a message that asks to name it
49
+ once beside that binding, since a `*.mock.ts` cannot see it. With the two `no-inline-test-data` fixes above,
50
+ this adds 1.16 kB min+gzip to `/eslint-plugin` (52.04 → 53.20 kB), which only ESLint loads, never a
51
+ test run.
52
+ - **`createAutoMock<T>(config)` — options without a placeholder seed.**
53
+ `createAutoMock<EventSource>({ returnsUndefined: ['close'] })` (and the same on `autoMocked`) reads
54
+ the bag as configuration instead of storing it as a seed, so `createAutoMock<T>(undefined, { … })`
55
+ is no longer the only spelling. The one argument counts as options only when every key is an option
56
+ and at least one of them is `returnsUndefined`, `selfReturning`, `returnsClass`,
57
+ `observablePropsToSpyOn`, `onUnstubbedCall` or `onUnstubbedRead`. `{ strict: true }`, `{ name }` or
58
+ `{ returns }` alone could be a real member of `T`, so they stay seeds at runtime and the compiler
59
+ rejects them where `T` has no such member; pass them second as before. Any second argument (`{}`
60
+ included) keeps the first a seed.
61
+ - **`returnsClass: { method: Class }` — a method that returns a double of another class, in one
62
+ entry.** `provideAutoSpy(ReportFactory, { returnsClass: { create: Report } })` replaces
63
+ `const report = createSpyFromClass(Report)` plus `returns: { create: asInstance(report) }`. Every
64
+ call answers the same `Spy<Report>`, one per outer double, reached as `asSpy(factory.create(…))`.
65
+ Taken by every factory that takes `returns` (`createSpyFromClass`, `createSpyFromInstance`,
66
+ `createAutoMock`, `autoMocked`, `provideAutoSpy`, `provideAutoSpyForToken`,
67
+ `registerAutoSpyDefaults`). It counts as configured under `strict`, merges key by key in
68
+ registrations, and a method also named in `returns` answers that value.
69
+ - **`doctor` warns when a build tsconfig ships the test data next to the specs**
70
+ (`tsconfig-ships-mock-file`). `no-inline-test-data` moves data to a `*.mock.ts` beside the spec,
71
+ and a generated `tsconfig.lib.json` usually excludes only `**/*.spec.ts`, so `tsc` or a
72
+ declaration plugin emits every mock file into the package. A config whose `exclude` has a spec glob
73
+ but lets a `*.mock.ts`, `*.fixtures.ts` or `__mocks__/` file through is reported, with the
74
+ `exclude` globs to add. App configs, configs next to `ng-package.json`, `noEmit` configs and
75
+ configs another one extends are left alone. The `no-inline-test-data` docs say the same.
76
+
13
77
  ## [5.55.0] - 2026-09-30
14
78
 
15
79
  ### Fixed
@@ -6684,7 +6748,8 @@ moved under 1 %: `/angular` +192 B (+1.0 %) for the override queue and the HTTP
6684
6748
  This copy ships with the package and carries 5.x only. Releases before 5.0.0 are in the
6685
6749
  [full changelog](https://github.com/ASDAlexey/vitest-auto-spy/blob/master/CHANGELOG.md).
6686
6750
 
6687
- [Unreleased]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.55.0...HEAD
6751
+ [Unreleased]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.56.0...HEAD
6752
+ [5.56.0]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.55.0...v5.56.0
6688
6753
  [5.55.0]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.54.0...v5.55.0
6689
6754
  [5.54.0]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.53.0...v5.54.0
6690
6755
  [5.53.0]: https://github.com/ASDAlexey/vitest-auto-spy/compare/v5.52.0...v5.53.0
package/README.md CHANGED
@@ -15,7 +15,7 @@ replacement for [`jest-auto-spies`](https://www.npmjs.com/package/jest-auto-spie
15
15
  [![downloads per month](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.npmjs.org%2Fdownloads%2Fpoint%2Flast-month%2Fvitest-auto-spy&query=%24.downloads&color=brightgreen&logo=npm&label=downloads%2Fmonth)](https://www.npmjs.com/package/vitest-auto-spy)
16
16
  [![downloads over 18 months](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.npmjs.org%2Fdownloads%2Fpoint%2F2026-06-21%3A2030-01-01%2Fvitest-auto-spy&query=%24.downloads&color=brightgreen&logo=npm&label=downloads%2F18mo)](https://www.npmjs.com/package/vitest-auto-spy)
17
17
  [![CI](https://github.com/ASDAlexey/vitest-auto-spy/actions/workflows/ci.yml/badge.svg)](https://github.com/ASDAlexey/vitest-auto-spy/actions/workflows/ci.yml)
18
- [![minzipped size](https://img.shields.io/badge/minzip-29.8%20kB-brightgreen)](#install)
18
+ [![minzipped size](https://img.shields.io/badge/minzip-30.0%20kB-brightgreen)](#install)
19
19
  [![types](https://img.shields.io/npm/types/vitest-auto-spy?logo=typescript&logoColor=white)](https://www.npmjs.com/package/vitest-auto-spy)
20
20
  [![coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)](https://github.com/ASDAlexey/vitest-auto-spy/actions/workflows/ci.yml)
21
21
  [![license](https://img.shields.io/npm/l/vitest-auto-spy?color=blue)](./LICENSE)
@@ -1295,6 +1295,7 @@ error tsconfig-glob-matches-nothing libs/users/tsconfig.spec.json
1295
1295
  | -------------------------------------- | --------------------------------------------------------------------------------------------------------- |
1296
1296
  | `tsconfig-glob-matches-nothing` | An `include` pattern that matches no file, so it type-checks nothing |
1297
1297
  | `tsconfig-file-missing` | A `files` entry naming a file that is gone |
1298
+ | `tsconfig-ships-mock-file` | A build tsconfig that excludes the specs but compiles the `*.mock.ts` next to them into the package |
1298
1299
  | `spec-imported-by-non-spec` | A production module importing a `*.spec.ts` |
1299
1300
  | `spec-exports-fixture` | A spec importing another spec, whose hooks then run in the wrong file |
1300
1301
  | `foreign-runner-pragma` | `@jest-config` or a bare `@jest-environment` that no runner here reads |
@@ -3812,6 +3813,7 @@ Helpers on each spied member, by return type:
3812
3813
  | `instanceMethodsToSpyOn` | same as `methodsToSpyOn`, for callables on the instance (`signal()` fields, arrow props, `signalStore()` methods) |
3813
3814
  | `observablePropsToSpyOn` | Observable properties to spy |
3814
3815
  | `returnsUndefined` | methods that answer `undefined`, counted as configured under `strict` |
3816
+ | `returnsClass` | `{ create: Report }`: the method answers one spy of that class per double, reached as `asSpy(double.create())` |
3815
3817
  | `gettersToSpyOn` / `settersToSpyOn` | accessors to spy |
3816
3818
  | `autoSpyAccessors` | spies every getter and setter on the prototype |
3817
3819
  | `fillMissing` | answers a name the prototype never had with a spy (a partially abstract class) |
@@ -84,8 +84,11 @@ cannot name, since ESM fails to link first — with the runner's entry to use. F
84
84
  Angular suites: `angular-testbed-split` (an Analog config without `server.deps.inline: ['vitest-auto-spy']`,
85
85
  which gives `/angular` a second `TestBed`), `angular-cache-off-in-ci` (the builder cache never reaches
86
86
  CI: +33 % per run on a 700-file suite), `shared-env-without-restore` (a shared environment without
87
- the `setupAutoSpy` restore options) and `mock-registry-capture-drops-sentinel` (a hand-rolled registry
88
- pruner that can drop the `clearAllMocks` sweep). The `tsconfig` checks do not judge a `../` entry,
87
+ the `setupAutoSpy` restore options; each setup file is judged on its own calls, an options object declared,
88
+ imported or spread counts, and a value it cannot read is never called off) and `mock-registry-capture-drops-sentinel` (a hand-rolled registry
89
+ pruner that can drop the `clearAllMocks` sweep). `tsconfig-ships-mock-file` warns about a build
90
+ tsconfig whose `exclude` leaves out the specs but not the `*.mock.ts` / `*.fixtures.ts` / `__mocks__/`
91
+ files beside them, so they ship in the package. The `tsconfig` checks do not judge a `../` entry,
89
92
  a missing generated `.d.ts` in `files`, or `include` on a scan that hit its cap, and the import graph
90
93
  ignores specifiers in comments and strings and follows tsconfig `paths` / `baseUrl` through `extends`.
91
94
  It is worth one run after any large edit to a test suite — especially after a codemod, which is where
@@ -36,6 +36,7 @@ createSpyFromClass(MyService, {
36
36
  | `overrides` | Replaces **any member** with the value as written — a field, a signal, an `Observable` property. The member is no longer a spy, except a plain function seeded on a method (class factories only), which becomes its spy. Named in both, `overrides` wins. |
37
37
  | `selfReturning` | The named methods answer the double itself — a default like `returns`; a name in both answers `returns`. |
38
38
  | `returnsUndefined` | The list form of `returns: { m: undefined }` — `provideAutoSpy(CartStore, { strict: true, returnsUndefined: ['add', 'remove', 'clear'] })`; a name also in `returns` answers that. `createAutoMock`, `provideAutoSpyForToken` and `registerAutoSpyDefaults` take it too. |
39
+ | `returnsClass` | `{ method: Class }` — the method answers a spy of that class, built once per double (`asSpy(double.m())` reaches it; that read is a call). The one-entry form of `returns: { m: asInstance(createSpyFromClass(Class)) }`; `returns` wins for the same name. Every factory that takes `returns` takes it. With nothing seeded, `createAutoMock<T>({ returnsUndefined: [...] })` takes the options first. |
39
40
 
40
41
  ### `instanceMethodsToSpyOn` for members discovery cannot see
41
42
 
@@ -73,7 +73,7 @@ export default [
73
73
  | `no-dead-schemas` | `error` | — | `schemas` on a testing module with no `declarations` — the schema applies to nothing; the file decides, so a `declarations` in another `configureTestingModule` call silences it |
74
74
  | `no-import-time-spread` | `error` | suggest | `export const x = [...Imported]` at module scope → a `TypeError`, or a silently empty object, while the bundle loads |
75
75
  | `no-unregistered-inject-spy` | `error` | — | `injectSpy(X)` for a token this file never registered → the real instance, whose spy helpers exist only for the compiler. A `providers` value is read when it is an array literal or a never-mutated `const` holding one (`{ providers }`, a quoted `'providers':` key too); anything else makes the file unreadable and silent |
76
- | `no-real-component-provider` | `error` | — | `fixture.debugElement.injector.get(X)` for a component-level provider nothing in the file replaced → the real store under a component spec; `overrideComponentProvider(CartComponent, X)` — the fix names the class `By.directive(…)` found or the one class the file creates, `Component` when there are several; `{ ignoreTokens }` for an intended integration test; `{ childInjectors: true }` also reads `query(…)`, `queryAll(…)[i]` and `children[i]` injectors, leaving classes named in `By.directive(…)` alone |
76
+ | `no-real-component-provider` | `error` | — | `fixture.debugElement.injector.get(X)` for a component-level provider nothing in the file replaced → the real store under a component spec; `overrideComponentProvider(CartComponent, X)` — the fix names the class `By.directive(…)` found or the one class the file creates, `Component` when there are several; `{ ignoreTokens }` for an intended integration test; `{ childInjectors: true }` also reads `query(…)`, `queryAll(…)[i]` and `children[i]` injectors, leaving classes named in `By.directive(…)` alone; classes the spec declares itself are doubles and never reported |
77
77
  | `prefer-render-shallow` | `warn` | suggest | `TestBed.createComponent` in a file that never reads the template → `renderShallow(X)`; 0.24× the per-test cycle at 100 children. Under `{ templates: 'never' }` also every DOM read (`nativeElement`, any `By.*`, the global `document`, `inject(DOCUMENT)`…, once per statement), a `@Component` with markup declared in the spec and a `template:` handed to `renderShallow` / `prepareShallow`; a file that calls or imports `createDirectiveHost` is exempt |
78
78
  | `prefer-set-inputs` | `warn` | suggest | a run of `fixture.componentRef.setInput('title', v)` on one fixture → `await setInputs(fixture, { title: v })` — the name is resolved against the compiled definition before the first write (an undeclared one is an `NG0303` and no change) and the value is typed. The run collapses into one call and a `detectChanges()` under it goes; offered, not applied, because `stable()` ticks and a zone.js suite answers that with `NG0101` |
79
79
  | `prefer-to-have-signal-value` | `warn` | `--fix` | `expect(component.total()).toBe(3)` / `toEqual(…)` → `expect(component.total).toHaveSignalValue(3)`, `toStrictEqual` → `{ strict: true }`, `toBeNull()` / `toBeUndefined()` → `toHaveSignalValue(null)` / `(undefined)`; the matcher names the signal in the failure and refuses a value that is not one. **Type-aware**: the signal is recognised by Angular's brand on its type, so methods, functions and getters are never reported, and without `parserOptions.project` it reports nothing. A `toBe` against an object-typed signal (`expect(list.items()).toBe(items)`) is an identity check the deep matcher would lose, so it is reported only when the expected value is a primitive literal or the signal's type is primitive |
@@ -100,7 +100,7 @@ export default [
100
100
  | `no-outer-binding-in-mock-factory` | `error` | — | a `vi.mock(path, factory)` factory reading a top-level `const` / `let` / `var` / `class` declared outside `vi.hoisted` — the factory is hoisted above it, so the read is `Cannot access 'x' before initialization` → `const { user } = vi.hoisted(() => ({ user: … }))`. Only reads made while the factory runs count; function declarations, imports, type positions and `vi.doMock` are not reported |
101
101
  | `no-relative-mock-under-builder` | `error` | — | `vi.mock` / `doMock` / `importMock` / `unmock` / `doUnmock` with a specifier starting `.` or `/` in a spec `@angular/build:unit-test` runs — the builder throws on it → `provideAutoSpy(X)`, or `overrideComponentProvider` for a component's own provider. **Silent until** an `@angular/build:unit-test` / `@nx/angular:unit-test` target serving the file is found (the `no-redundant-mock-reset` search) or `{ builder: 'unit-test' }` says so; a tsconfig path alias to a workspace file is reported too (the builder bundles it, so the mock silently does nothing) unless every run's `buildTarget` lists it in `externalDependencies` |
102
102
  | `no-real-wait-in-test` | `warn` | — | a sleep on the real clock — `new Promise((r) => setTimeout(r, N))` in any spelling where `resolve` reaches the timer, `setTimeout(N)` from `node:timers/promises`; a `sleep(ms)` helper once, at its definition; a missing or `0` delay is left alone → `setupFakeTimers()` + `await advanceTimers(N)`, or wait for the outcome (`vi.waitFor`, `fixture.whenStable()`) |
103
- | `no-inline-test-data` | `warn` | — | test data inline in a spec — a data literal over `maxLines` (20) lines, or the same literal `repeats` (3) times in one file with at least `minValues` (2) values, one spelled out → export it once from `<name>.mock.ts` next to the spec. Never reported: module wiring (`providers`, `imports`…), `it.each` tables, `vi.mock` factories, literals holding a function, and files named `*.mock.ts` / `*.fixture.ts` / under `__mocks__/` |
103
+ | `no-inline-test-data` | `warn` | — | test data inline in a spec — a data literal over `maxLines` (20) lines, or the same literal `repeats` (3) times in one file with at least `minValues` (2) values, one spelled out → export it once from `<name>.mock.ts` next to the spec (a `tsc`-built library must add `**/*.mock.ts` to its build tsconfig's `exclude`). A copy that reads a name the spec declares → a spec-local `const` instead. A long expected value (`toEqual`, `toMatchObject`, `toHaveBeenCalledWith`…) → keep its shape inline, move the largest part the message names. Never reported: module wiring (`providers`, `imports`…), `it.each` tables, `vi.mock` factories, literals holding a function, short tuples (`[1, 5]`, `['0', '1']`) and flag bags (≤ 3 boolean keys) as repeats, and files named `*.mock.ts` / `*.fixture.ts` / under `__mocks__/` |
104
104
  | `no-disabled-testbed-teardown` | `error` | — | `destroyAfterEach: false`, in `initTestEnvironment` or one `configureTestingModule` — every fixture outlives its test, `ngOnDestroy` never runs → delete it (Angular's default since v13) and fix the test that then fails. A config scoped to `**/*.spec.ts` must add the setup file to `files` |
105
105
  | `no-redundant-mock-reset` | `error` | `--fix` / suggest | a mock reset the runner already performs between tests — `vi.clearAllMocks()` / `resetAllMocks()` / `restoreAllMocks()`, `x.mockClear()` / `mockReset()` / `mockRestore()` — standing where nothing the file wrote ran since the runner's own: the first statement of a `beforeEach` no other `beforeEach` precedes, or a clear as the last statement of an `afterEach` → delete it, and the hook with it where that is all it held. A restore or reset in `afterEach` / `afterAll` is never reported: after the last test it is what takes a spy off before the `afterAll` hooks. **Silent** until the flags are known: options `{ clearMocks, restoreMocks, mockReset }` (or `{ configFile }` naming the runner config) first, then a `vitest.config.*` / `vite.config.*` searched upwards from the file and read as text; a config that leaves `clearMocks` out counts it on from Vitest 5 (its default). Where an `@angular/build:unit-test` / `@nx/angular:unit-test` target (found in `angular.json` / `project.json` above the file) also serves the spec, a config flag counts only if that target's `runnerConfig` applies it too — without `runnerConfig` the builder runs Vitest's defaults, so `restoreMocks` / `mockReset` from `vitest.config.ts` do not make a reset dead there, while a clear stays reported on Vitest 5; the rule's inline flags are not narrowed. A config built by a factory or `mergeConfig` from another module is not read through — name its flags as `{ configFile, configFlags: { clearMocks: true } }`, read as if the file set them, so the builder narrowing still applies (`configFlags` needs `configFile`; `doctor` notes the case as `mock-reset-config-unread`). `setupAutoSpy({ restoreMocks: true })` is not the runner's `restoreMocks` (it restores in an `afterEach`, after the test) — never pass the rule a flag only the setup file sets. Flag matches call, never family — `restoreMocks` walks only the spies `vi.spyOn` installed. `--fix` only in a file whose only before-hook it is; a suggestion otherwise; never inside a test body |
106
106
  | `no-unasserted-argument` | `warn` | — | a bare `expect(spy).toHaveBeenCalled()` on evidence from the file: the same subject asserted with `toHaveBeenCalledWith(…)` in another test, or a title containing `with` over a body whose every assertion is a bare call → `toHaveBeenCalledWith(…)` / `mustBeCalledWith(…)`. `not.toHaveBeenCalled()` and the counting matchers are never reported |
@@ -51,6 +51,20 @@ not with the intersection spelt out. `returns` also takes an optional method wri
51
51
  `getMinZoom?: (() => number) | undefined` — the way Leaflet and other third-party typings declare
52
52
  them.
53
53
 
54
+ **Options alone go in the first argument** when nothing is seeded:
55
+ `createAutoMock<EventSource>({ returnsUndefined: ['close'] })`. The single argument is read as options
56
+ only when every key is an option and at least one is `returnsUndefined`, `selfReturning`,
57
+ `returnsClass`, `observablePropsToSpyOn`, `onUnstubbedCall` or `onUnstubbedRead`; `autoMocked` reads
58
+ it the same way. `{ strict: true }`, `{ name }` or `{ returns }` alone could be members of `T`, so the
59
+ compiler rejects them there — pass them second, `createAutoMock<T>(undefined, { strict: true })`. Any
60
+ second argument (`{}` included) keeps the first a seed.
61
+
62
+ **A method that returns another class's double is one entry:** `returnsClass: { create: Report }` on
63
+ any factory that takes `returns` builds `createSpyFromClass(Report)` once per outer double and makes
64
+ `create()` answer it. Reach it with `asSpy(factory.create('a'))` — typed `Spy<Report>`, but that read
65
+ is a recorded call, so keep `const report = createSpyFromClass(Report)` +
66
+ `returns: { create: asInstance(report) }` when the spec asserts `create`'s call count.
67
+
54
68
  `createMock<T>()` is the one to reach for on data shapes — it returns a plain `T`, so it satisfies a
55
69
  `no-type-assertion` lint rule without an `eslint-disable` on every fixture. `createMock<T>(undefined)`
56
70
  is the same call as `createMock<T>()` and answers `{}`, **not** `undefined` — a forwarding helper
@@ -158,7 +172,7 @@ but the last is a _read_. A node that is **called** returns what it was configur
158
172
  default that is `undefined`, so `mockDeep<AppLogger>().channel('app').info('x')` is a `TypeError` at
159
173
  the second call — while `DeepMockProxy<AppLogger>` types it perfectly, so nothing warns. Pass
160
174
  `{ selfReturning: true }` for a fluent API, or use
161
- `createAutoMock<T>(undefined, { selfReturning: ['channel'] })` when only one method chains:
175
+ `createAutoMock<T>({ selfReturning: ['channel'] })` when only one method chains:
162
176
 
163
177
  ```ts
164
178
  const logger = mockDeep<AppLogger>({}, { selfReturning: true });
@@ -204,7 +218,7 @@ the same path in the assertion, or, for an API where every command answers the *
204
218
  `createAutoMock` instead, where `selfReturning` names methods that answer one double:
205
219
 
206
220
  ```ts
207
- const chain = createAutoMock<ChainedCommands>(undefined, { selfReturning: ['focus', 'insertContent'] });
221
+ const chain = createAutoMock<ChainedCommands>({ selfReturning: ['focus', 'insertContent'] });
208
222
  const editor = createAutoMock<Editor>(undefined, { returns: { chain: asInstance(chain) } });
209
223
 
210
224
  editor.chain().focus().insertContent('text').run();
@@ -1,14 +1,14 @@
1
1
  import { pendingRequestsReport, assertAngularInternals, instrumentTestBed, onTestingModuleConfigured, onComponentCreated, HTTP_TESTING_BRAND, beforeTestBedReset, verifyOnTeardown } from './chunk-JCTHGJTY.js';
2
2
  export { disableTestBedDiagnostics, enableTestBedDiagnostics, formatSpecTiming, getTestBedTiming, instrumentTestBed, reportSpecTiming } from './chunk-JCTHGJTY.js';
3
- import { failOnUnspiedProvider, onTestBedFileEnd, isLazyDoubleFactory } from './chunk-OXONPFSL.js';
3
+ import { failOnUnspiedProvider, onTestBedFileEnd, isLazyDoubleFactory } from './chunk-KHALREYP.js';
4
4
  import './chunk-T5MQSNRX.js';
5
5
  import './chunk-4JY7KIJG.js';
6
- import './chunk-JMBAECZN.js';
7
- import './chunk-UTOPAD66.js';
6
+ import './chunk-RQLUH6RE.js';
7
+ import './chunk-LKXOKRTC.js';
8
8
  import './chunk-F7UPX6YV.js';
9
9
  import './chunk-PC3FAZT3.js';
10
- import './chunk-MDWE3FCP.js';
11
- import { isAutoSpyLike } from './chunk-UOKFQQ5H.js';
10
+ import './chunk-UH2Q7RTQ.js';
11
+ import { isAutoSpyLike } from './chunk-TXC3L3FO.js';
12
12
  import { count, sourceClassName, taskName } from './chunk-DYAS4OK4.js';
13
13
  import { angularPendingRequests, angularShadowedProviders, angularDeadSchemas, angularNgModuleScopesAuto } from './chunk-IATDAQMO.js';
14
14
  import { withDocs } from './chunk-ENCEEH23.js';
@@ -1,6 +1,6 @@
1
1
  import './vitest-mock-types-B17-xaWt.js';
2
2
  import { InjectionToken, AbstractType, Injector, ValueProvider, FactoryProvider, ProviderToken, ChangeDetectorRef } from '@angular/core';
3
- import { h as AddSpyMethodsByReturnTypes, S as Spy, F as Func } from './types-qYoxQi5C.js';
3
+ import { h as AddSpyMethodsByReturnTypes, S as Spy, F as Func } from './types-NphKNopY.js';
4
4
  import { DomSanitizer } from '@angular/platform-browser';
5
5
  import 'vitest';
6
6
 
@@ -1,16 +1,16 @@
1
- import { useVitestAdapter } from './chunk-ZVF3E6T7.js';
2
- import { describeInstance } from './chunk-M4CUD2XH.js';
1
+ import { useVitestAdapter } from './chunk-JFROAGGY.js';
2
+ import { describeInstance } from './chunk-3OEYMUV3.js';
3
3
  import { angularInternalsError } from './chunk-4JY7KIJG.js';
4
- import { createSpyFromClass } from './chunk-UTOPAD66.js';
5
- import './chunk-HRE4K6N3.js';
6
- import './chunk-7LZ6V5UO.js';
4
+ import { createSpyFromClass } from './chunk-LKXOKRTC.js';
5
+ import './chunk-XZ5JUXKT.js';
6
+ import './chunk-ZTT2QLMJ.js';
7
7
  import './chunk-YHDBRBGU.js';
8
8
  import './chunk-75WPOZKE.js';
9
9
  import './chunk-F7UPX6YV.js';
10
10
  import './chunk-PC3FAZT3.js';
11
11
  import './chunk-MXKNUVYR.js';
12
- import { createFunctionSpy } from './chunk-MDWE3FCP.js';
13
- import './chunk-UOKFQQ5H.js';
12
+ import { createFunctionSpy } from './chunk-UH2Q7RTQ.js';
13
+ import './chunk-TXC3L3FO.js';
14
14
  import { sourceClassName } from './chunk-DYAS4OK4.js';
15
15
  import { angularDialog } from './chunk-IATDAQMO.js';
16
16
  import { withDocs } from './chunk-ENCEEH23.js';
@@ -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-qYoxQi5C.js';
3
+ import { h as AddSpyMethodsByReturnTypes } from './types-NphKNopY.js';
4
4
  import { SpyLocation } from '@angular/common/testing';
5
5
 
6
6
  /**
@@ -1,8 +1,8 @@
1
- import { describeInstance } from './chunk-M4CUD2XH.js';
1
+ import { describeInstance } from './chunk-3OEYMUV3.js';
2
2
  import { angularInternalsError } from './chunk-4JY7KIJG.js';
3
3
  import { getTestFinishedHook } from './chunk-MXKNUVYR.js';
4
- import { createFunctionSpy } from './chunk-MDWE3FCP.js';
5
- import './chunk-UOKFQQ5H.js';
4
+ import { createFunctionSpy } from './chunk-UH2Q7RTQ.js';
5
+ import './chunk-TXC3L3FO.js';
6
6
  import { count } from './chunk-DYAS4OK4.js';
7
7
  import { angularRouteDouble, angularRouterInject, angularRouterEvents, angularLocationDouble, angularRouteWiring, angularRouterDouble } from './chunk-IATDAQMO.js';
8
8
  import { withDocs } from './chunk-ENCEEH23.js';
package/dist/angular.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import './vitest-mock-types-B17-xaWt.js';
2
- export { w as AngularTokenProvider, A as AngularValueProvider, a as AutoSpiedInstance, C as ComponentInputs, b as CreateWithAutoSpiesOptions, E as ElementConstructor, N as NativeElementHolder, P as PreparedShallow, R as RenderShallowOptions, c as ResourceStatusLike, d as RunCounter, S as SettleResourceOptions, e as ShallowOverrides, f as ShallowRender, g as SpyRegistry, h as StableOptions, i as createWithAutoSpies, j as flushEffects, k as hostElement, l as injectSpy, p as prepareShallow, m as provideAutoSpy, x as provideAutoSpyForToken, q as queryElement, r as renderShallow, n as runEffect, s as setInputs, o as settleResource, t as stable, u as trackEffectRuns, v as trackRecomputations } from './track-signal-runs-CM-leczv.js';
3
- import { o as DeepPartial, m as ClassType, C as ClassSpyConfiguration, S as Spy, t as OnlyMethodKeysOf, h as AddSpyMethodsByReturnTypes, r as NotAPublicKey } from './types-qYoxQi5C.js';
4
- export { J as SubjectOf } from './types-qYoxQi5C.js';
2
+ export { w as AngularTokenProvider, A as AngularValueProvider, a as AutoSpiedInstance, C as ComponentInputs, b as CreateWithAutoSpiesOptions, E as ElementConstructor, N as NativeElementHolder, P as PreparedShallow, R as RenderShallowOptions, c as ResourceStatusLike, d as RunCounter, S as SettleResourceOptions, e as ShallowOverrides, f as ShallowRender, g as SpyRegistry, h as StableOptions, i as createWithAutoSpies, j as flushEffects, k as hostElement, l as injectSpy, p as prepareShallow, m as provideAutoSpy, x as provideAutoSpyForToken, q as queryElement, r as renderShallow, n as runEffect, s as setInputs, o as settleResource, t as stable, u as trackEffectRuns, v as trackRecomputations } from './track-signal-runs-BDQ6MqwO.js';
3
+ import { o as DeepPartial, m as ClassType, C as ClassSpyConfiguration, S as Spy, u as OnlyMethodKeysOf, h as AddSpyMethodsByReturnTypes, s as NotAPublicKey } from './types-NphKNopY.js';
4
+ export { K as SubjectOf } from './types-NphKNopY.js';
5
5
  import { InjectionToken, Provider, Type, WritableSignal, Signal } from '@angular/core';
6
- import { A as AutoMockConfiguration, D as DeepReadonly } from './emission-sync-xEda8ZCk.js';
7
- 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, n as expectNoEmissionSync, s as setEmissionTimeout } from './emission-sync-xEda8ZCk.js';
6
+ import { b as AutoMockConfiguration, D as DeepReadonly } from './emission-sync-CNbHIKGX.js';
7
+ export { C as CallbackSubscribable, E as EmissionObserver, e as EmissionOptions, f as EmissionSource, S as SubscribableLike, j as expectAllEmissions, k as expectCompletion, l as expectEmission, m as expectEmissions, n as expectError, o as expectNoEmission, p as expectNoEmissionSync, s as setEmissionTimeout } from './emission-sync-CNbHIKGX.js';
8
8
  import { TestAPI } from 'vitest';
9
- export { I as InjectionLog, T as TrackInjectionsOptions, a as TrackedProvider, t as trackInjections } from './track-injections-C6zITWXE.js';
10
- 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-CE9gNMPY.js';
9
+ export { I as InjectionLog, T as TrackInjectionsOptions, a as TrackedProvider, t as trackInjections } from './track-injections-BkGvSEzV.js';
10
+ 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-vydpb5c5.js';
11
11
  import '@angular/core/testing';
12
12
 
13
13
  /**
@@ -1,10 +1,10 @@
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, C as ClassSpyConfiguration, m 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 ObservablePropSpyMethods, t as OnlyMethodKeysOf, u as OnlyObservablePropsOf, v as OnlyPropsOf, w as Overload, x as OverloadChoice, y as Overloads, P as PropStubValue, S as Spy, z as SpyDisposable, B as SpyOptions, G as StrictSpyConfiguration, H as SubjectLike, J as SubjectOf, U as UnstubbedCall, K as UnstubbedCallHandler, L as UnstubbedRead, Q as UnstubbedReadHandler, V as ValueConfig, R as ValueConfigPerCall, W as WithMockReturnValue } from './types-qYoxQi5C.js';
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, C as ClassSpyConfiguration, m 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 MethodReturnsClass, r as Mutable, N as NextValueConfig, s as NotAPublicKey, O as ObservableLike, t as ObservablePropSpyMethods, u as OnlyMethodKeysOf, v as OnlyObservablePropsOf, w as OnlyPropsOf, x as Overload, y as OverloadChoice, z as Overloads, P as PropStubValue, S as Spy, B as SpyDisposable, G as SpyOptions, H as StrictSpyConfiguration, J as SubjectLike, K as SubjectOf, U as UnstubbedCall, L as UnstubbedCallHandler, Q as UnstubbedRead, R as UnstubbedReadHandler, V as ValueConfig, T as ValueConfigPerCall, W as WithMockReturnValue } from './types-NphKNopY.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 './core.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, n as expectNoEmissionSync, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './emission-sync-xEda8ZCk.js';
4
- export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-COBYU0WJ.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-CE9gNMPY.js';
6
- export { C as CreateNestUnitOptions, N as NestUnit, a as NestUnitClass, b as NestUnitProvider, c as NestUnitSpies, d as createNestUnit } from './nest-unit-Bg6JWPgu.js';
7
- export { A as AngularValueProvider, a as AutoSpiedInstance, C as ComponentInputs, b as CreateWithAutoSpiesOptions, E as ElementConstructor, N as NativeElementHolder, P as PreparedShallow, R as RenderShallowOptions, c as ResourceStatusLike, d as RunCounter, S as SettleResourceOptions, e as ShallowOverrides, f as ShallowRender, g as SpyRegistry, h as StableOptions, i as createWithAutoSpies, j as flushEffects, k as hostElement, l as injectSpy, p as prepareShallow, m as provideAutoSpy, q as queryElement, r as renderShallow, n as runEffect, s as setInputs, o as settleResource, t as stable, u as trackEffectRuns, v as trackRecomputations } from './track-signal-runs-CM-leczv.js';
3
+ export { A as AutoMockConfigMarker, a as AutoMockConfigOnly, b as AutoMockConfiguration, c as AutoMocked, d as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, e as EmissionOptions, f as EmissionSource, S as SubscribableLike, g as autoMocked, h as clearAutoSpyDefaults, i as createAutoMock, j as expectAllEmissions, k as expectCompletion, l as expectEmission, m as expectEmissions, n as expectError, o as expectNoEmission, p as expectNoEmissionSync, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './emission-sync-CNbHIKGX.js';
4
+ export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-Dhlx2i2x.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-vydpb5c5.js';
6
+ export { C as CreateNestUnitOptions, N as NestUnit, a as NestUnitClass, b as NestUnitProvider, c as NestUnitSpies, d as createNestUnit } from './nest-unit-DdJ251KZ.js';
7
+ export { A as AngularValueProvider, a as AutoSpiedInstance, C as ComponentInputs, b as CreateWithAutoSpiesOptions, E as ElementConstructor, N as NativeElementHolder, P as PreparedShallow, R as RenderShallowOptions, c as ResourceStatusLike, d as RunCounter, S as SettleResourceOptions, e as ShallowOverrides, f as ShallowRender, g as SpyRegistry, h as StableOptions, i as createWithAutoSpies, j as flushEffects, k as hostElement, l as injectSpy, p as prepareShallow, m as provideAutoSpy, q as queryElement, r as renderShallow, n as runEffect, s as setInputs, o as settleResource, t as stable, u as trackEffectRuns, v as trackRecomputations } from './track-signal-runs-BDQ6MqwO.js';
8
8
  import '@angular/core';
9
9
  import '@angular/core/testing';
10
10
 
@@ -1,25 +1,25 @@
1
- import { withTestBedSplitExplained } from './chunk-OXONPFSL.js';
2
- export { injectSpy, provideAutoSpy } from './chunk-OXONPFSL.js';
1
+ import { withTestBedSplitExplained } from './chunk-KHALREYP.js';
2
+ export { injectSpy, provideAutoSpy } from './chunk-KHALREYP.js';
3
3
  import { stable, flushEffects } from './chunk-RHGDQQNC.js';
4
4
  export { flushEffects, stable } from './chunk-RHGDQQNC.js';
5
5
  import { readSignalSymbol } from './chunk-T5MQSNRX.js';
6
6
  import { angularInternalsError } from './chunk-4JY7KIJG.js';
7
7
  import './chunk-VLEU3CWT.js';
8
- import { createSpyForToken } from './chunk-TIXTHSW4.js';
9
- export { createNestUnit } from './chunk-TIXTHSW4.js';
10
- export { adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromInstance, describeDuplicateCopies, expectAllEmissions, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, expectNoEmissionSync, flushEventLoop, flushEventLoopUntil, getPackageCopies, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, restoreSpiedInstance, setEmissionTimeout, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './chunk-GHKBJN2T.js';
11
- import { mockValueProp } from './chunk-JMBAECZN.js';
12
- export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, reportPropsOutsideHooks, restoreMockedProps } from './chunk-JMBAECZN.js';
13
- import { closestName } from './chunk-UTOPAD66.js';
14
- export { autoMocked, clearAutoSpy, clearAutoSpyDefaults, createAutoMock, createSpyFromClass, registerAutoSpyDefaults, resetAutoSpy } from './chunk-UTOPAD66.js';
8
+ import { createSpyForToken } from './chunk-RAJTKMDV.js';
9
+ export { createNestUnit } from './chunk-RAJTKMDV.js';
10
+ export { adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromInstance, describeDuplicateCopies, expectAllEmissions, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, expectNoEmissionSync, flushEventLoop, flushEventLoopUntil, getPackageCopies, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, restoreSpiedInstance, setEmissionTimeout, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './chunk-3IINYLDB.js';
11
+ import { mockValueProp } from './chunk-RQLUH6RE.js';
12
+ export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, reportPropsOutsideHooks, restoreMockedProps } from './chunk-RQLUH6RE.js';
13
+ import { closestName } from './chunk-LKXOKRTC.js';
14
+ export { autoMocked, clearAutoSpy, clearAutoSpyDefaults, createAutoMock, createSpyFromClass, registerAutoSpyDefaults, resetAutoSpy } from './chunk-LKXOKRTC.js';
15
15
  import { fakeClockBacklog } from './chunk-SF4GKKN4.js';
16
16
  import './chunk-SOROJD3W.js';
17
17
  import './chunk-75WPOZKE.js';
18
18
  import './chunk-F7UPX6YV.js';
19
19
  import './chunk-PC3FAZT3.js';
20
20
  import './chunk-MXKNUVYR.js';
21
- export { createFunctionSpy, errorHandler } from './chunk-MDWE3FCP.js';
22
- import { libraryWarn } from './chunk-UOKFQQ5H.js';
21
+ export { createFunctionSpy, errorHandler } from './chunk-UH2Q7RTQ.js';
22
+ import { libraryWarn } from './chunk-TXC3L3FO.js';
23
23
  import { displayPath, sourceClassName, count } from './chunk-DYAS4OK4.js';
24
24
  import { angularEffects, angularTrackRuns, bunAngular, angularUnreadResource, angularCreateWithAutoSpies, angularResources, angularTypedElements, angularOverrideLate, angularInputs, angularKeepTemplate } from './chunk-IATDAQMO.js';
25
25
  import { withDocs } from './chunk-ENCEEH23.js';
package/dist/bun.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, C as ClassSpyConfiguration, m 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 ObservablePropSpyMethods, t as OnlyMethodKeysOf, u as OnlyObservablePropsOf, v as OnlyPropsOf, w as Overload, x as OverloadChoice, y as Overloads, P as PropStubValue, S as Spy, z as SpyDisposable, B as SpyOptions, G as StrictSpyConfiguration, H as SubjectLike, J as SubjectOf, U as UnstubbedCall, K as UnstubbedCallHandler, L as UnstubbedRead, Q as UnstubbedReadHandler, V as ValueConfig, R as ValueConfigPerCall, W as WithMockReturnValue } from './types-qYoxQi5C.js';
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, C as ClassSpyConfiguration, m 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 MethodReturnsClass, r as Mutable, N as NextValueConfig, s as NotAPublicKey, O as ObservableLike, t as ObservablePropSpyMethods, u as OnlyMethodKeysOf, v as OnlyObservablePropsOf, w as OnlyPropsOf, x as Overload, y as OverloadChoice, z as Overloads, P as PropStubValue, S as Spy, B as SpyDisposable, G as SpyOptions, H as StrictSpyConfiguration, J as SubjectLike, K as SubjectOf, U as UnstubbedCall, L as UnstubbedCallHandler, Q as UnstubbedRead, R as UnstubbedReadHandler, V as ValueConfig, T as ValueConfigPerCall, W as WithMockReturnValue } from './types-NphKNopY.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 './core.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, n as expectNoEmissionSync, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './emission-sync-xEda8ZCk.js';
4
- export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-COBYU0WJ.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-CE9gNMPY.js';
6
- export { C as CreateNestUnitOptions, N as NestUnit, a as NestUnitClass, b as NestUnitProvider, c as NestUnitSpies, d as createNestUnit } from './nest-unit-Bg6JWPgu.js';
3
+ export { A as AutoMockConfigMarker, a as AutoMockConfigOnly, b as AutoMockConfiguration, c as AutoMocked, d as AutoSpyDefaultEntry, C as CallbackSubscribable, E as EmissionObserver, e as EmissionOptions, f as EmissionSource, S as SubscribableLike, g as autoMocked, h as clearAutoSpyDefaults, i as createAutoMock, j as expectAllEmissions, k as expectCompletion, l as expectEmission, m as expectEmissions, n as expectError, o as expectNoEmission, p as expectNoEmissionSync, r as registerAutoSpyDefaults, s as setEmissionTimeout } from './emission-sync-CNbHIKGX.js';
4
+ export { c as createFunctionSpy, d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-Dhlx2i2x.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-vydpb5c5.js';
6
+ export { C as CreateNestUnitOptions, N as NestUnit, a as NestUnitClass, b as NestUnitProvider, c as NestUnitSpies, d as createNestUnit } from './nest-unit-DdJ251KZ.js';
package/dist/bun.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import './chunk-VLEU3CWT.js';
2
- export { createNestUnit } from './chunk-TIXTHSW4.js';
3
- export { adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromInstance, describeDuplicateCopies, expectAllEmissions, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, expectNoEmissionSync, flushEventLoop, flushEventLoopUntil, getPackageCopies, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, restoreSpiedInstance, setEmissionTimeout, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './chunk-GHKBJN2T.js';
4
- export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, reportPropsOutsideHooks, restoreMockedProps } from './chunk-JMBAECZN.js';
5
- export { autoMocked, clearAutoSpy, clearAutoSpyDefaults, createAutoMock, createSpyFromClass, registerAutoSpyDefaults, resetAutoSpy } from './chunk-UTOPAD66.js';
2
+ export { createNestUnit } from './chunk-RAJTKMDV.js';
3
+ export { adoptMock, asInstance, asInstances, asSpy, assertMocked, captureArg, createFixture, createFixtureFactory, createLog, createMock, createSpyClass, createSpyFromInstance, describeDuplicateCopies, expectAllEmissions, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, expectNoEmissionSync, flushEventLoop, flushEventLoopUntil, getPackageCopies, mockConstructor, mockDeep, moduleNamespace, narrow, outOfType, restoreSpiedInstance, setEmissionTimeout, settleDynamicImport, spyOnOwnMethod, spyOnVoidMethod, stubConstructor, withOverrides } from './chunk-3IINYLDB.js';
4
+ export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, reportPropsOutsideHooks, restoreMockedProps } from './chunk-RQLUH6RE.js';
5
+ export { autoMocked, clearAutoSpy, clearAutoSpyDefaults, createAutoMock, createSpyFromClass, registerAutoSpyDefaults, resetAutoSpy } from './chunk-LKXOKRTC.js';
6
6
  import './chunk-SF4GKKN4.js';
7
7
  import './chunk-SOROJD3W.js';
8
8
  import './chunk-75WPOZKE.js';
9
9
  import './chunk-F7UPX6YV.js';
10
10
  import './chunk-PC3FAZT3.js';
11
11
  import './chunk-MXKNUVYR.js';
12
- export { createFunctionSpy, errorHandler } from './chunk-MDWE3FCP.js';
13
- import './chunk-UOKFQQ5H.js';
12
+ export { createFunctionSpy, errorHandler } from './chunk-UH2Q7RTQ.js';
13
+ import './chunk-TXC3L3FO.js';
14
14
  import './chunk-DYAS4OK4.js';
15
15
  import './chunk-IATDAQMO.js';
16
16
  import './chunk-ENCEEH23.js';
@@ -1,11 +1,11 @@
1
- import { mockValueProp, mockAccessorsProp } from './chunk-JMBAECZN.js';
2
- import { resolveConfiguration, mergeAutoSpyDefaults, resolveReadGuard, mergeMethodNames, getCallableMemberNames, createTrackedPropSpy, applyConfiguredReturns, createSpyFromClass, warnOnUnknownMethods, warnOnAccessorNamingAMethod, resolveAccessors, createAccessorsSpies, ownerOf, createProxyPropStore, storeWriteTraps, describeStoredProp, hasStoredProp, isProtocolKey, isDeletedProp, readStoredAccessor, NOT_STORED, disposeAutoSpy, writeStoredValue } from './chunk-UTOPAD66.js';
1
+ import { mockValueProp, mockAccessorsProp } from './chunk-RQLUH6RE.js';
2
+ import { resolveConfiguration, mergeAutoSpyDefaults, resolveReadGuard, mergeMethodNames, getCallableMemberNames, createTrackedPropSpy, applyConfiguredReturns, createSpyFromClass, warnOnUnknownMethods, warnOnAccessorNamingAMethod, resolveAccessors, createAccessorsSpies, ownerOf, createProxyPropStore, storeWriteTraps, describeStoredProp, hasStoredProp, isProtocolKey, isDeletedProp, readStoredAccessor, NOT_STORED, disposeAutoSpy, writeStoredValue } from './chunk-LKXOKRTC.js';
3
3
  import { fakeClockAdvice, fakeClockBacklog } from './chunk-SF4GKKN4.js';
4
4
  import { unpatchedSetTimeout, unpatchedClearTimeout } from './chunk-SOROJD3W.js';
5
5
  import { redefineFailure } from './chunk-F7UPX6YV.js';
6
6
  import { DISPOSE } from './chunk-PC3FAZT3.js';
7
- import { defineHelper, adoptFunctionSpy, reinstallDispatch, serializeValue, resolveUnstubbedGuard, createFunctionSpy } from './chunk-MDWE3FCP.js';
8
- import { isMarkedMock, reportMisconfiguration, DEEP_CHILDREN } from './chunk-UOKFQQ5H.js';
7
+ import { defineHelper, adoptFunctionSpy, reinstallDispatch, serializeValue, resolveUnstubbedGuard, createFunctionSpy } from './chunk-UH2Q7RTQ.js';
8
+ import { isMarkedMock, reportMisconfiguration, DEEP_CHILDREN } from './chunk-TXC3L3FO.js';
9
9
  import { count, displayPath } from './chunk-DYAS4OK4.js';
10
10
  import { moduleMocksAssert, moduleMocksNoOp, narrow, adoptMock, observableFailures, strictModePassthrough, createSpyFromClassReturns, captureArg, eventLoopUntil, mockConstructor, createSpyFromClassLiveDomNode } from './chunk-IATDAQMO.js';
11
11
  import { withDocs } from './chunk-ENCEEH23.js';
@@ -1,4 +1,4 @@
1
- import { isAutoSpyLike } from './chunk-UOKFQQ5H.js';
1
+ import { isAutoSpyLike } from './chunk-TXC3L3FO.js';
2
2
  import { sourceClassName } from './chunk-DYAS4OK4.js';
3
3
 
4
4
  // src/lib/angular-instance-name.ts
@@ -1,4 +1,4 @@
1
- import { createVitestMockAdapter } from './chunk-HRE4K6N3.js';
1
+ import { createVitestMockAdapter } from './chunk-XZ5JUXKT.js';
2
2
  import { registerRunnerHooks } from './chunk-MXKNUVYR.js';
3
3
  import { hasMockAdapter, registerMockAdapter } from './shared-state.js';
4
4
  import { vi, afterEach, beforeEach } from 'vitest';
@@ -1,6 +1,6 @@
1
- import { currentSpecFile } from './chunk-JMBAECZN.js';
2
- import { createSpyFromClass } from './chunk-UTOPAD66.js';
3
- import { isAutoSpyLike, misconfigurationThrows, reportMisconfiguration } from './chunk-UOKFQQ5H.js';
1
+ import { currentSpecFile } from './chunk-RQLUH6RE.js';
2
+ import { createSpyFromClass } from './chunk-LKXOKRTC.js';
3
+ import { isAutoSpyLike, misconfigurationThrows, reportMisconfiguration } from './chunk-TXC3L3FO.js';
4
4
  import { count, displayPath, sourceClassName } from './chunk-DYAS4OK4.js';
5
5
  import { setup, angularComponentStub, angularInjectSpyReal, angularTestBedCopies, installationVitest } from './chunk-IATDAQMO.js';
6
6
  import { withDocs } from './chunk-ENCEEH23.js';