vitest-auto-spy 3.12.1 → 3.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -958,8 +958,19 @@ by a dynamic `import()` inside a test — and says so explicitly:
958
958
  export const navigation = { setFocus: keepMockRegistered(vi.fn()) };
959
959
  ```
960
960
 
961
- `trackMockRegistry()` installs the pair of hooks on its own, `pruneMockRegistry()` is the one-shot
962
- sweep (it returns how many went) and `getMockRegistrySize()` reports what is left.
961
+ The mocks it keeps, it also guards. Staying registered means `vi.resetAllMocks()` reaches them too —
962
+ it walks the same set and calls `mockReset()`, which puts an implementation back only when it was
963
+ passed to `vi.fn(implementation)`; behaviour chained on with `.mockReturnValue(…)` or
964
+ `.mockReturnThis()` is simply lost. Under `isolate: false` that surfaces in a *different* file later
965
+ in the same worker, inside application code, as `Cannot read properties of undefined` against a
966
+ shared double that spec never touched — and `vi.restoreAllMocks()` does not cause it (Vitest 4 walks
967
+ `MOCK_RESTORE` there, which only `vi.spyOn` writes to), so probing with that one comes back green and
968
+ sends the search the wrong way. The implementation a long-lived mock carried when it was classified
969
+ is therefore remembered and put back, in `beforeEach`, but only when it has gone missing.
970
+
971
+ `trackMockRegistry()` installs the hooks on its own, `pruneMockRegistry()` is the one-shot sweep (it
972
+ returns how many went), `restoreLongLivedImplementations()` is that repair (it returns how many it
973
+ put back) and `getMockRegistrySize()` reports what is left.
963
974
 
964
975
  Two more switches, both about the environment rather than the spies:
965
976
 
package/README.md CHANGED
@@ -1901,7 +1901,7 @@ single-purpose utility you can pick up independently — they all ride on the sa
1901
1901
  | `installPerTest(install)` | `/setup` | Re-install a stub before every test of the block — a `describe`-level stub is restored away after the first |
1902
1902
  | `setupAngularTestEnv(opts)` | `/angular` | Zone and zoneless spec files in one worker, switching platforms per file |
1903
1903
  | `restoreTimerGlobals()` | `/setup` | Put back timer globals that uninstalling the fakes deleted rather than restored |
1904
- | `trackMockRegistry()` / `keepMockRegistered(mock)` | `/setup` | Keep @vitest/spy's mock registry to the mocks that outlive a file; mark one the split would miss ([details](#test-run-hygiene)) |
1904
+ | `trackMockRegistry()` / `keepMockRegistered(mock)` / `restoreLongLivedImplementations()` | `/setup` | Keep @vitest/spy's mock registry to the mocks that outlive a file; mark one the split would miss; put back an implementation a cross-file `vi.resetAllMocks()` dropped ([details](#test-run-hygiene)) |
1905
1905
  | `errorHandler` | core | The `mustBeCalledWith` argument-mismatch reporter — swap it to customize failure output |
1906
1906
 
1907
1907
  A taste of the DI pair — provide the spy, inject it back fully typed:
@@ -2065,7 +2065,12 @@ expensive to diagnose when it is missing. The first three are on by default:
2065
2065
  component trees. Pruning it is easy to get wrong in one specific way: drop the module-level
2066
2066
  `vi.fn()` that six spec files import from a shared `*.mock.ts` and nothing clears it any more, so
2067
2067
  its calls accumulate and the file that happens to run second fails on calls its predecessor made.
2068
- `pruneMockRegistry` keeps what a file inherited and drops only what it added.
2068
+ `pruneMockRegistry` keeps what a file inherited and drops only what it added. Keeping a mock
2069
+ registered also means `vi.resetAllMocks()` can reach it — `mockReset` drops an implementation
2070
+ that came from a chained `.mockReturnValue(…)`, which under `isolate: false` kills a *later*
2071
+ file's test on a double it never touched — so `trackMockRegistry()` remembers the implementation
2072
+ each long-lived mock carried and puts it back before a test that has lost it
2073
+ (`restoreLongLivedImplementations()` is that repair on its own, and returns how many it put back).
2069
2074
  9. **A hook that ran out of a budget nobody meant to give it.** On by default, because it only ever
2070
2075
  appends a sentence to a test that has already failed. Jest applies one `testTimeout` to a hook and
2071
2076
  to a test body alike; Vitest resolves `hookTimeout` separately and defaults it to 10 000 ms, so a
@@ -2395,6 +2400,7 @@ names are unfindable from these messages otherwise — no `TS2739` text contains
2395
2400
  | `TS2345: Argument of type 'Spy<X>' is not assignable to parameter of type 'X'` | the same, in an argument | `asInstance(spy)`, or `asInstances(a, b, c)` |
2396
2401
  | `TS2322: Type 'Spy<X>' is not assignable to type 'Mocked<X>' …` | the variable was declared `Mocked<T>` | declare it `Spy<T>` |
2397
2402
  | `'AddPromiseSpyMethods<unknown>' is missing … from type 'WithMockReturnValue<…>'` | a generic class inferred as `Service<any>` | `asSpy<Service>(…)` / `injectSpy<Service>(…)` |
2403
+ | `TS2345` / `TS2554` **on a call to a spied method** (wrong arguments) | the arguments the real method rejects — the double's call signature is the method's own; it used to accept anything | fix the call; don't re-widen the spy |
2398
2404
  | `TS2739 … 'Spy<X>' is missing …` **on a line with `injectSpy`** | the provider handed back the real object | `provideAutoSpy(X)`, or an honest `TestBed.inject` |
2399
2405
 
2400
2406
  Two notes that cost real time when they are missing.
package/dist/angular.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { l as AngularTokenProvider, A as AngularValueProvider, a as AutoSpiedInstance, C as ComponentInputs, b as CreateWithAutoSpiesOptions, R as RenderShallowOptions, c as ResourceStatusLike, S as SettleResourceOptions, d as ShallowRender, e as SpyRegistry, f as StableOptions, g as createWithAutoSpies, h as flushEffects, i as injectSpy, p as provideAutoSpy, m as provideAutoSpyForToken, r as renderShallow, j as runEffect, s as settleResource, k as stable } from './zoneless-BUNSBSIP.js';
1
+ export { l as AngularTokenProvider, A as AngularValueProvider, a as AutoSpiedInstance, C as ComponentInputs, b as CreateWithAutoSpiesOptions, R as RenderShallowOptions, c as ResourceStatusLike, S as SettleResourceOptions, d as ShallowRender, e as SpyRegistry, f as StableOptions, g as createWithAutoSpies, h as flushEffects, i as injectSpy, p as provideAutoSpy, m as provideAutoSpyForToken, r as renderShallow, j as runEffect, s as settleResource, k as stable } from './zoneless-CEhs7o9p.js';
2
2
  import { Type, Signal, WritableSignal } from '@angular/core';
3
- import { S as Spy, C as ClassType, a as ClassSpyConfiguration, O as OnlyMethodKeysOf, j as AddSpyMethodsByReturnTypes } from './types-it6CnDkI.js';
4
- export { I as InjectionLog, T as TrackInjectionsOptions, a as TrackedProvider, t as trackInjections } from './track-injections-BAzV5ITq.js';
5
- export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-IgCwv_40.js';
6
- export { C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-CuGjE0YR.js';
3
+ import { S as Spy, C as ClassType, a as ClassSpyConfiguration, O as OnlyMethodKeysOf, j as AddSpyMethodsByReturnTypes } from './types-Br-Usge9.js';
4
+ export { I as InjectionLog, T as TrackInjectionsOptions, a as TrackedProvider, t as trackInjections } from './track-injections-BQndbppn.js';
5
+ export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-DyjtZVoA.js';
6
+ export { C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-DMx5uXie.js';
7
7
  import '@angular/core/testing';
8
8
  import 'rxjs';
9
9
  import 'vitest';
package/dist/angular.js CHANGED
@@ -1796,7 +1796,14 @@ var AutoSpyInjector = class extends Injector {
1796
1796
  tokens() {
1797
1797
  return [...this.#spies.keys()];
1798
1798
  }
1799
+ knows(token) {
1800
+ return this.#spies.has(token);
1801
+ }
1799
1802
  };
1803
+ function describeToken(token) {
1804
+ const name = Reflect.get(Object(token), "name");
1805
+ return typeof name === "string" ? name : String(token);
1806
+ }
1800
1807
  function factoryOf(target) {
1801
1808
  const factory = Reflect.get(target, "\u0275fac");
1802
1809
  return typeof factory === "function" ? factory : void 0;
@@ -1811,6 +1818,14 @@ function createWithAutoSpies(target, options = {}) {
1811
1818
  injector,
1812
1819
  spies: {
1813
1820
  get: (token) => {
1821
+ if (!autoSpies.knows(token) && injector.get(token, null, { optional: true }) === null) {
1822
+ throw new Error(
1823
+ withDocs(
1824
+ `[vitest-auto-spy] createWithAutoSpies(${describeToken(target)}).spies.get(${describeToken(token)}): the instance never asked for that token, and nothing in \`providers\` supplies it, so the spy you would get back is not the one it uses. Auto-spied tokens: ${autoSpies.tokens().map(describeToken).join(", ") || "(none)"}.`,
1825
+ DOCS_LINKS.angular
1826
+ )
1827
+ );
1828
+ }
1814
1829
  return injector.get(token);
1815
1830
  },
1816
1831
  autoSpiedTokens: () => autoSpies.tokens()
@@ -1,9 +1,9 @@
1
- export { d as AccessorKeysOf, e as AddAccessorsSpies, f as AddCalledWithObservable, g as AddCalledWithPromise, h as AddCalledWithSpyMethods, A as AddObservableSpyMethods, i as AddPromiseSpyMethods, j as AddSpyMethodsByReturnTypes, k as AddVoidReturnHelpers, a as ClassSpyConfiguration, C as ClassType, b as CompleteValueConfig, D as DeepMockProxy, l as DeepPartial, E as ErrorValueConfig, F as Func, M as MethodReturns, m as Mutable, N as NextValueConfig, O as OnlyMethodKeysOf, n as OnlyObservablePropsOf, o as OnlyPropsOf, p as Overload, q as Overloads, P as PropStubValue, S as Spy, r as SpyDisposable, s as SpyOptions, t as StrictSpyConfiguration, U as UnstubbedCall, u as UnstubbedCallHandler, V as ValueConfig, c as ValueConfigPerCall, W as WithMockReturnValue } from './types-it6CnDkI.js';
1
+ export { d as AccessorKeysOf, e as AddAccessorsSpies, f as AddCalledWithObservable, g as AddCalledWithPromise, h as AddCalledWithSpyMethods, A as AddObservableSpyMethods, i as AddPromiseSpyMethods, j as AddSpyMethodsByReturnTypes, k as AddVoidReturnHelpers, a as ClassSpyConfiguration, C as ClassType, b as CompleteValueConfig, D as DeepMockProxy, l as DeepPartial, E as ErrorValueConfig, F as Func, M as MethodReturns, m as Mutable, N as NextValueConfig, O as OnlyMethodKeysOf, n as OnlyObservablePropsOf, o as OnlyPropsOf, p as Overload, q as Overloads, P as PropStubValue, S as Spy, r as SpyDisposable, s as SpyOptions, t as StrictSpyConfiguration, U as UnstubbedCall, u as UnstubbedCallHandler, V as ValueConfig, c as ValueConfigPerCall, W as WithMockReturnValue } from './types-Br-Usge9.js';
2
2
  export { ArgCaptor, AsInstances, AssertMockedOptions, ConstructorMock, ConstructorSpy, FixtureFactory, FlushUntilOptions, IntersectionObserverStubOptions, MediaElementState, MediaElementStub, MediaElementStubOptions, MockDeepOptions, ModuleNamespace, ModuleNamespaceOptions, MutationRecordInit, ObserverGlobal, ObserverInstance, ObserverStub, ObserverStubOptions, ResizeEntryRect, TestRunComparison, TestRunReport, TestRunSummary, asInstance, asInstances, asSpy, assertMocked, captureArg, clearAutoSpy, compareTestRuns, createFixture, createFixtureFactory, createFunctionSpy, createMock, createSpyClass, createSpyFromClass, diffByField, errorHandler, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resetAutoSpy, resizeEntry, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './bun.js';
3
- export { A as AutoMockConfiguration, C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, c as autoMocked, d as createAutoMock, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-CuGjE0YR.js';
4
- export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-IgCwv_40.js';
3
+ export { A as AutoMockConfiguration, C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, c as autoMocked, d as createAutoMock, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-DMx5uXie.js';
4
+ export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-DyjtZVoA.js';
5
5
  export { d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-B1pqa-Sh.js';
6
- export { A as AngularValueProvider, a as AutoSpiedInstance, C as ComponentInputs, b as CreateWithAutoSpiesOptions, R as RenderShallowOptions, c as ResourceStatusLike, S as SettleResourceOptions, d as ShallowRender, e as SpyRegistry, f as StableOptions, g as createWithAutoSpies, h as flushEffects, i as injectSpy, p as provideAutoSpy, r as renderShallow, j as runEffect, s as settleResource, k as stable } from './zoneless-BUNSBSIP.js';
6
+ export { A as AngularValueProvider, a as AutoSpiedInstance, C as ComponentInputs, b as CreateWithAutoSpiesOptions, R as RenderShallowOptions, c as ResourceStatusLike, S as SettleResourceOptions, d as ShallowRender, e as SpyRegistry, f as StableOptions, g as createWithAutoSpies, h as flushEffects, i as injectSpy, p as provideAutoSpy, r as renderShallow, j as runEffect, s as settleResource, k as stable } from './zoneless-CEhs7o9p.js';
7
7
  import 'rxjs';
8
8
  import 'vitest';
9
9
  import '@angular/core';
@@ -72,6 +72,12 @@ declare function registerDomGlobals(options?: RegisterDomGlobalsOptions): Promis
72
72
  * implementation. A property the target refuses to accept is skipped rather than fatal — a locked
73
73
  * global is not worth failing a whole test run over.
74
74
  *
75
+ * Skipped, but **not** in silence when it is one of {@link FORCED_GLOBALS}: those are the five the
76
+ * DOM is useless without, so a refused `document` means the environment came up half-installed and
77
+ * the first spec that touches it reports `document is not defined` — naming neither this helper nor
78
+ * the property that refused. The rest stay quiet, because a host built-in keeping its own
79
+ * implementation is the documented outcome rather than a problem.
80
+ *
75
81
  * @example
76
82
  * ```ts
77
83
  * copyWindowGlobals(dom.window as unknown as Record<string, unknown>, globalThis as Record<string, unknown>);
@@ -1,7 +1,7 @@
1
1
  import './chunk-Y4YG7UOK.js';
2
2
  import { createSpyForToken } from './chunk-JV5XRAS4.js';
3
3
  import './chunk-NQXXUJPS.js';
4
- export { asInstance, asInstances, asSpy, assertMocked, captureArg, compareTestRuns, createFixture, createFixtureFactory, createMock, createSpyClass, describeDuplicateCopies, diffByField, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, getPackageCopies, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resizeEntry, setEmissionTimeout, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './chunk-ZBVBJFNW.js';
4
+ export { asInstance, asInstances, asSpy, assertMocked, captureArg, compareTestRuns, createFixture, createFixtureFactory, createMock, createSpyClass, describeDuplicateCopies, diffByField, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, getPackageCopies, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resizeEntry, setEmissionTimeout, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './chunk-IKH4OTMV.js';
5
5
  export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, restoreMockedProps } from './chunk-R4EWAG7Y.js';
6
6
  import { createSpyFromClass } from './chunk-7YTPHYP7.js';
7
7
  export { autoMocked, clearAutoSpy, createAutoMock, createSpyFromClass, resetAutoSpy } from './chunk-7YTPHYP7.js';
@@ -160,6 +160,7 @@ ${failures.join("\n") || " - (no registrars were configured)"}`,
160
160
  }
161
161
  function copyWindowGlobals(source, target) {
162
162
  const keys = [...FORCED_GLOBALS, ...Object.getOwnPropertyNames(source)];
163
+ const refused = [];
163
164
  for (const key of keys) {
164
165
  if (key.startsWith("_")) {
165
166
  continue;
@@ -170,9 +171,21 @@ function copyWindowGlobals(source, target) {
170
171
  }
171
172
  try {
172
173
  Object.defineProperty(target, key, { value, configurable: true, writable: true, enumerable: true });
173
- } catch {
174
+ } catch (error) {
175
+ if (FORCED_GLOBALS.includes(key)) {
176
+ refused.push(`${key} (${describeError(error)})`);
177
+ }
174
178
  }
175
179
  }
180
+ if (refused.length === 0) {
181
+ return;
182
+ }
183
+ console.warn(
184
+ withDocs(
185
+ `[vitest-auto-spy] copyWindowGlobals: the host refused to redefine ${refused.join(", ")}. The DOM is only half-installed, and the failure will arrive later as "document is not defined" or an unrelated jsdom assertion, naming neither this helper nor the property. Something sealed that global before the preload ran.`,
186
+ DOCS_LINKS.bunAngular
187
+ )
188
+ );
176
189
  }
177
190
  function createJsdomRegistrar(options) {
178
191
  return {
@@ -237,7 +250,14 @@ var AutoSpyInjector = class extends Injector {
237
250
  tokens() {
238
251
  return [...this.#spies.keys()];
239
252
  }
253
+ knows(token) {
254
+ return this.#spies.has(token);
255
+ }
240
256
  };
257
+ function describeToken(token) {
258
+ const name = Reflect.get(Object(token), "name");
259
+ return typeof name === "string" ? name : String(token);
260
+ }
241
261
  function factoryOf(target) {
242
262
  const factory = Reflect.get(target, "\u0275fac");
243
263
  return typeof factory === "function" ? factory : void 0;
@@ -252,6 +272,14 @@ function createWithAutoSpies(target, options = {}) {
252
272
  injector,
253
273
  spies: {
254
274
  get: (token) => {
275
+ if (!autoSpies.knows(token) && injector.get(token, null, { optional: true }) === null) {
276
+ throw new Error(
277
+ withDocs(
278
+ `[vitest-auto-spy] createWithAutoSpies(${describeToken(target)}).spies.get(${describeToken(token)}): the instance never asked for that token, and nothing in \`providers\` supplies it, so the spy you would get back is not the one it uses. Auto-spied tokens: ${autoSpies.tokens().map(describeToken).join(", ") || "(none)"}.`,
279
+ DOCS_LINKS.angular
280
+ )
281
+ );
282
+ }
255
283
  return injector.get(token);
256
284
  },
257
285
  autoSpiedTokens: () => autoSpies.tokens()
package/dist/bun.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { s as SpyOptions, C as ClassType, a as ClassSpyConfiguration, O as OnlyMethodKeysOf, S as Spy, l as DeepPartial, D as DeepMockProxy, F as Func, u as UnstubbedCallHandler, j as AddSpyMethodsByReturnTypes } from './types-it6CnDkI.js';
2
- export { d as AccessorKeysOf, e as AddAccessorsSpies, f as AddCalledWithObservable, g as AddCalledWithPromise, h as AddCalledWithSpyMethods, A as AddObservableSpyMethods, i as AddPromiseSpyMethods, k as AddVoidReturnHelpers, b as CompleteValueConfig, E as ErrorValueConfig, M as MethodReturns, m as Mutable, N as NextValueConfig, n as OnlyObservablePropsOf, o as OnlyPropsOf, p as Overload, q as Overloads, P as PropStubValue, r as SpyDisposable, t as StrictSpyConfiguration, U as UnstubbedCall, V as ValueConfig, c as ValueConfigPerCall, W as WithMockReturnValue } from './types-it6CnDkI.js';
3
- export { A as AutoMockConfiguration, C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, c as autoMocked, d as createAutoMock, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-CuGjE0YR.js';
4
- export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-IgCwv_40.js';
1
+ import { s as SpyOptions, C as ClassType, a as ClassSpyConfiguration, O as OnlyMethodKeysOf, S as Spy, l as DeepPartial, D as DeepMockProxy, F as Func, u as UnstubbedCallHandler, j as AddSpyMethodsByReturnTypes } from './types-Br-Usge9.js';
2
+ export { d as AccessorKeysOf, e as AddAccessorsSpies, f as AddCalledWithObservable, g as AddCalledWithPromise, h as AddCalledWithSpyMethods, A as AddObservableSpyMethods, i as AddPromiseSpyMethods, k as AddVoidReturnHelpers, b as CompleteValueConfig, E as ErrorValueConfig, M as MethodReturns, m as Mutable, N as NextValueConfig, n as OnlyObservablePropsOf, o as OnlyPropsOf, p as Overload, q as Overloads, P as PropStubValue, r as SpyDisposable, t as StrictSpyConfiguration, U as UnstubbedCall, V as ValueConfig, c as ValueConfigPerCall, W as WithMockReturnValue } from './types-Br-Usge9.js';
3
+ export { A as AutoMockConfiguration, C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, c as autoMocked, d as createAutoMock, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-DMx5uXie.js';
4
+ export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-DyjtZVoA.js';
5
5
  export { d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-B1pqa-Sh.js';
6
6
  import { Mock } from 'vitest';
7
7
  import 'rxjs';
@@ -790,6 +790,11 @@ interface AssertMockedOptions {
790
790
  *
791
791
  * Worth naming when the factory stubs part of a module and re-exports the rest: without a list,
792
792
  * a factory that lost the one export the test drives still looks mocked.
793
+ *
794
+ * An **empty** list is rejected rather than accepted: `exports: []` — which is what
795
+ * `Object.keys(stubs)` or a filtered constant produces when it comes out empty — used to take the
796
+ * named-exports branch, find nothing to check and return, so the one call in the file whose job
797
+ * is to prove the mock applied proved nothing.
793
798
  */
794
799
  exports?: readonly string[];
795
800
  }
package/dist/bun.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import './chunk-Y4YG7UOK.js';
2
2
  import './chunk-NQXXUJPS.js';
3
- export { asInstance, asInstances, asSpy, assertMocked, captureArg, compareTestRuns, createFixture, createFixtureFactory, createMock, createSpyClass, describeDuplicateCopies, diffByField, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, getPackageCopies, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resizeEntry, setEmissionTimeout, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './chunk-ZBVBJFNW.js';
3
+ export { asInstance, asInstances, asSpy, assertMocked, captureArg, compareTestRuns, createFixture, createFixtureFactory, createMock, createSpyClass, describeDuplicateCopies, diffByField, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, getPackageCopies, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resizeEntry, setEmissionTimeout, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './chunk-IKH4OTMV.js';
4
4
  export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, restoreMockedProps } from './chunk-R4EWAG7Y.js';
5
5
  export { autoMocked, clearAutoSpy, createAutoMock, createSpyFromClass, resetAutoSpy } from './chunk-7YTPHYP7.js';
6
6
  export { createFunctionSpy, errorHandler } from './chunk-3AWKPZCE.js';
@@ -442,6 +442,14 @@ var SILENT_NO_OP_CAUSES = "A `vi.mock()` that does not apply reports nothing: un
442
442
  var assertMocked = defineHelper((namespace, options = {}) => {
443
443
  const target = describeTarget(options.specifier);
444
444
  const required = options.exports;
445
+ if (required?.length === 0) {
446
+ throw new Error(
447
+ withDocs(
448
+ `[vitest-auto-spy] assertMocked(${target}): the \`exports\` list is empty, so this call cannot fail and proves nothing. Drop the option to check that at least one export is a mock, or name the exports the test drives.`,
449
+ DOCS_LINKS.moduleMocks
450
+ )
451
+ );
452
+ }
445
453
  if (required) {
446
454
  const real = required.filter((name) => !isRunnerMock(Reflect.get(namespace, name)));
447
455
  if (real.length > 0) {
package/dist/console.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { j as AddSpyMethodsByReturnTypes } from './types-it6CnDkI.js';
1
+ import { j as AddSpyMethodsByReturnTypes } from './types-Br-Usge9.js';
2
2
  import 'rxjs';
3
3
  import 'vitest';
4
4
 
@@ -1,4 +1,4 @@
1
- import { t as StrictSpyConfiguration, n as OnlyObservablePropsOf, M as MethodReturns, l as DeepPartial, S as Spy, s as SpyOptions } from './types-it6CnDkI.js';
1
+ import { t as StrictSpyConfiguration, n as OnlyObservablePropsOf, M as MethodReturns, l as DeepPartial, S as Spy, s as SpyOptions } from './types-Br-Usge9.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,7 +1,7 @@
1
- export { d as AccessorKeysOf, e as AddAccessorsSpies, f as AddCalledWithObservable, g as AddCalledWithPromise, h as AddCalledWithSpyMethods, A as AddObservableSpyMethods, i as AddPromiseSpyMethods, j as AddSpyMethodsByReturnTypes, k as AddVoidReturnHelpers, a as ClassSpyConfiguration, C as ClassType, b as CompleteValueConfig, D as DeepMockProxy, l as DeepPartial, E as ErrorValueConfig, F as Func, M as MethodReturns, m as Mutable, N as NextValueConfig, O as OnlyMethodKeysOf, n as OnlyObservablePropsOf, o as OnlyPropsOf, p as Overload, q as Overloads, P as PropStubValue, S as Spy, r as SpyDisposable, s as SpyOptions, t as StrictSpyConfiguration, U as UnstubbedCall, u as UnstubbedCallHandler, V as ValueConfig, c as ValueConfigPerCall, W as WithMockReturnValue } from './types-it6CnDkI.js';
1
+ export { d as AccessorKeysOf, e as AddAccessorsSpies, f as AddCalledWithObservable, g as AddCalledWithPromise, h as AddCalledWithSpyMethods, A as AddObservableSpyMethods, i as AddPromiseSpyMethods, j as AddSpyMethodsByReturnTypes, k as AddVoidReturnHelpers, a as ClassSpyConfiguration, C as ClassType, b as CompleteValueConfig, D as DeepMockProxy, l as DeepPartial, E as ErrorValueConfig, F as Func, M as MethodReturns, m as Mutable, N as NextValueConfig, O as OnlyMethodKeysOf, n as OnlyObservablePropsOf, o as OnlyPropsOf, p as Overload, q as Overloads, P as PropStubValue, S as Spy, r as SpyDisposable, s as SpyOptions, t as StrictSpyConfiguration, U as UnstubbedCall, u as UnstubbedCallHandler, V as ValueConfig, c as ValueConfigPerCall, W as WithMockReturnValue } from './types-Br-Usge9.js';
2
2
  export { ArgCaptor, AsInstances, AssertMockedOptions, ConstructorMock, ConstructorSpy, FixtureFactory, FlushUntilOptions, IntersectionObserverStubOptions, MediaElementState, MediaElementStub, MediaElementStubOptions, MockDeepOptions, ModuleNamespace, ModuleNamespaceOptions, MutationRecordInit, ObserverGlobal, ObserverInstance, ObserverStub, ObserverStubOptions, ResizeEntryRect, TestRunComparison, TestRunReport, TestRunSummary, asInstance, asInstances, asSpy, assertMocked, captureArg, clearAutoSpy, compareTestRuns, createFixture, createFixtureFactory, createFunctionSpy, createMock, createSpyClass, createSpyFromClass, diffByField, errorHandler, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resetAutoSpy, resizeEntry, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './bun.js';
3
- export { A as AutoMockConfiguration, C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, c as autoMocked, d as createAutoMock, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-CuGjE0YR.js';
4
- export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-IgCwv_40.js';
3
+ export { A as AutoMockConfiguration, C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, c as autoMocked, d as createAutoMock, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-DMx5uXie.js';
4
+ export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-DyjtZVoA.js';
5
5
  export { d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-B1pqa-Sh.js';
6
6
  import 'rxjs';
7
7
  import 'vitest';
package/dist/index.js CHANGED
@@ -1621,6 +1621,14 @@ var SILENT_NO_OP_CAUSES = "A `vi.mock()` that does not apply reports nothing: un
1621
1621
  var assertMocked = defineHelper((namespace, options = {}) => {
1622
1622
  const target = describeTarget2(options.specifier);
1623
1623
  const required = options.exports;
1624
+ if (required?.length === 0) {
1625
+ throw new Error(
1626
+ withDocs(
1627
+ `[vitest-auto-spy] assertMocked(${target}): the \`exports\` list is empty, so this call cannot fail and proves nothing. Drop the option to check that at least one export is a mock, or name the exports the test drives.`,
1628
+ DOCS_LINKS.moduleMocks
1629
+ )
1630
+ );
1631
+ }
1624
1632
  if (required) {
1625
1633
  const real = required.filter((name) => !isRunnerMock(Reflect.get(namespace, name)));
1626
1634
  if (real.length > 0) {
package/dist/nestjs.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as ClassType, S as Spy, a as ClassSpyConfiguration, O as OnlyMethodKeysOf } from './types-it6CnDkI.js';
2
- export { I as InjectionLog, T as TrackInjectionsOptions, a as TrackedProvider, t as trackInjections } from './track-injections-BAzV5ITq.js';
1
+ import { C as ClassType, S as Spy, a as ClassSpyConfiguration, O as OnlyMethodKeysOf } from './types-Br-Usge9.js';
2
+ export { I as InjectionLog, T as TrackInjectionsOptions, a as TrackedProvider, t as trackInjections } from './track-injections-BQndbppn.js';
3
3
  import 'rxjs';
4
4
  import 'vitest';
5
5
 
package/dist/node.cjs CHANGED
@@ -1961,6 +1961,14 @@ var SILENT_NO_OP_CAUSES = "A `vi.mock()` that does not apply reports nothing: un
1961
1961
  var assertMocked = defineHelper((namespace, options = {}) => {
1962
1962
  const target = describeTarget2(options.specifier);
1963
1963
  const required = options.exports;
1964
+ if (required?.length === 0) {
1965
+ throw new Error(
1966
+ withDocs(
1967
+ `[vitest-auto-spy] assertMocked(${target}): the \`exports\` list is empty, so this call cannot fail and proves nothing. Drop the option to check that at least one export is a mock, or name the exports the test drives.`,
1968
+ DOCS_LINKS.moduleMocks
1969
+ )
1970
+ );
1971
+ }
1964
1972
  if (required) {
1965
1973
  const real = required.filter((name) => !isRunnerMock(Reflect.get(namespace, name)));
1966
1974
  if (real.length > 0) {
package/dist/node.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { d as AccessorKeysOf, e as AddAccessorsSpies, f as AddCalledWithObservable, g as AddCalledWithPromise, h as AddCalledWithSpyMethods, A as AddObservableSpyMethods, i as AddPromiseSpyMethods, j as AddSpyMethodsByReturnTypes, k as AddVoidReturnHelpers, a as ClassSpyConfiguration, C as ClassType, b as CompleteValueConfig, D as DeepMockProxy, l as DeepPartial, E as ErrorValueConfig, F as Func, M as MethodReturns, m as Mutable, N as NextValueConfig, O as OnlyMethodKeysOf, n as OnlyObservablePropsOf, o as OnlyPropsOf, p as Overload, q as Overloads, P as PropStubValue, S as Spy, r as SpyDisposable, s as SpyOptions, t as StrictSpyConfiguration, U as UnstubbedCall, u as UnstubbedCallHandler, V as ValueConfig, c as ValueConfigPerCall, W as WithMockReturnValue } from './types-it6CnDkI.js';
1
+ export { d as AccessorKeysOf, e as AddAccessorsSpies, f as AddCalledWithObservable, g as AddCalledWithPromise, h as AddCalledWithSpyMethods, A as AddObservableSpyMethods, i as AddPromiseSpyMethods, j as AddSpyMethodsByReturnTypes, k as AddVoidReturnHelpers, a as ClassSpyConfiguration, C as ClassType, b as CompleteValueConfig, D as DeepMockProxy, l as DeepPartial, E as ErrorValueConfig, F as Func, M as MethodReturns, m as Mutable, N as NextValueConfig, O as OnlyMethodKeysOf, n as OnlyObservablePropsOf, o as OnlyPropsOf, p as Overload, q as Overloads, P as PropStubValue, S as Spy, r as SpyDisposable, s as SpyOptions, t as StrictSpyConfiguration, U as UnstubbedCall, u as UnstubbedCallHandler, V as ValueConfig, c as ValueConfigPerCall, W as WithMockReturnValue } from './types-Br-Usge9.js';
2
2
  export { ArgCaptor, AsInstances, AssertMockedOptions, ConstructorMock, ConstructorSpy, FixtureFactory, FlushUntilOptions, IntersectionObserverStubOptions, MediaElementState, MediaElementStub, MediaElementStubOptions, MockDeepOptions, ModuleNamespace, ModuleNamespaceOptions, MutationRecordInit, ObserverGlobal, ObserverInstance, ObserverStub, ObserverStubOptions, ResizeEntryRect, TestRunComparison, TestRunReport, TestRunSummary, asInstance, asInstances, asSpy, assertMocked, captureArg, clearAutoSpy, compareTestRuns, createFixture, createFixtureFactory, createFunctionSpy, createMock, createSpyClass, createSpyFromClass, diffByField, errorHandler, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resetAutoSpy, resizeEntry, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './bun.js';
3
- export { A as AutoMockConfiguration, C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, c as autoMocked, d as createAutoMock, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-CuGjE0YR.js';
4
- export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-IgCwv_40.js';
3
+ export { A as AutoMockConfiguration, C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, c as autoMocked, d as createAutoMock, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-DMx5uXie.js';
4
+ export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-DyjtZVoA.js';
5
5
  export { d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-B1pqa-Sh.js';
6
6
  import 'rxjs';
7
7
  import 'vitest';
package/dist/node.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRedefineMockAdapter } from './chunk-NQXXUJPS.js';
2
- export { asInstance, asInstances, asSpy, assertMocked, captureArg, compareTestRuns, createFixture, createFixtureFactory, createMock, createSpyClass, describeDuplicateCopies, diffByField, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, getPackageCopies, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resizeEntry, setEmissionTimeout, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './chunk-ZBVBJFNW.js';
2
+ export { asInstance, asInstances, asSpy, assertMocked, captureArg, compareTestRuns, createFixture, createFixtureFactory, createMock, createSpyClass, describeDuplicateCopies, diffByField, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, getPackageCopies, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resizeEntry, setEmissionTimeout, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './chunk-IKH4OTMV.js';
3
3
  export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, restoreMockedProps } from './chunk-R4EWAG7Y.js';
4
4
  export { autoMocked, clearAutoSpy, createAutoMock, createSpyFromClass, resetAutoSpy } from './chunk-7YTPHYP7.js';
5
5
  export { createFunctionSpy, errorHandler } from './chunk-3AWKPZCE.js';
@@ -1,4 +1,4 @@
1
- import { P as PropStubValue } from './types-it6CnDkI.js';
1
+ import { P as PropStubValue } from './types-Br-Usge9.js';
2
2
 
3
3
  /** Undoes a single `mock*Prop` patch; calling it more than once is a no-op. */
4
4
  type RestoreProp = () => void;
package/dist/react.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { d as AccessorKeysOf, e as AddAccessorsSpies, f as AddCalledWithObservable, g as AddCalledWithPromise, h as AddCalledWithSpyMethods, A as AddObservableSpyMethods, i as AddPromiseSpyMethods, j as AddSpyMethodsByReturnTypes, k as AddVoidReturnHelpers, a as ClassSpyConfiguration, C as ClassType, b as CompleteValueConfig, D as DeepMockProxy, l as DeepPartial, E as ErrorValueConfig, F as Func, M as MethodReturns, m as Mutable, N as NextValueConfig, O as OnlyMethodKeysOf, n as OnlyObservablePropsOf, o as OnlyPropsOf, p as Overload, q as Overloads, P as PropStubValue, S as Spy, r as SpyDisposable, s as SpyOptions, t as StrictSpyConfiguration, U as UnstubbedCall, u as UnstubbedCallHandler, V as ValueConfig, c as ValueConfigPerCall, W as WithMockReturnValue } from './types-it6CnDkI.js';
1
+ export { d as AccessorKeysOf, e as AddAccessorsSpies, f as AddCalledWithObservable, g as AddCalledWithPromise, h as AddCalledWithSpyMethods, A as AddObservableSpyMethods, i as AddPromiseSpyMethods, j as AddSpyMethodsByReturnTypes, k as AddVoidReturnHelpers, a as ClassSpyConfiguration, C as ClassType, b as CompleteValueConfig, D as DeepMockProxy, l as DeepPartial, E as ErrorValueConfig, F as Func, M as MethodReturns, m as Mutable, N as NextValueConfig, O as OnlyMethodKeysOf, n as OnlyObservablePropsOf, o as OnlyPropsOf, p as Overload, q as Overloads, P as PropStubValue, S as Spy, r as SpyDisposable, s as SpyOptions, t as StrictSpyConfiguration, U as UnstubbedCall, u as UnstubbedCallHandler, V as ValueConfig, c as ValueConfigPerCall, W as WithMockReturnValue } from './types-Br-Usge9.js';
2
2
  export { ArgCaptor, AsInstances, AssertMockedOptions, ConstructorMock, ConstructorSpy, FixtureFactory, FlushUntilOptions, IntersectionObserverStubOptions, MediaElementState, MediaElementStub, MediaElementStubOptions, MockDeepOptions, ModuleNamespace, ModuleNamespaceOptions, MutationRecordInit, ObserverGlobal, ObserverInstance, ObserverStub, ObserverStubOptions, ResizeEntryRect, TestRunComparison, TestRunReport, TestRunSummary, asInstance, asInstances, asSpy, assertMocked, captureArg, clearAutoSpy, compareTestRuns, createFixture, createFixtureFactory, createFunctionSpy, createMock, createSpyClass, createSpyFromClass, diffByField, errorHandler, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resetAutoSpy, resizeEntry, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './bun.js';
3
- export { A as AutoMockConfiguration, C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, c as autoMocked, d as createAutoMock, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-CuGjE0YR.js';
4
- export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-IgCwv_40.js';
3
+ export { A as AutoMockConfiguration, C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, c as autoMocked, d as createAutoMock, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-DMx5uXie.js';
4
+ export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-DyjtZVoA.js';
5
5
  export { d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-B1pqa-Sh.js';
6
6
  import 'rxjs';
7
7
  import 'vitest';
package/dist/react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { vitestMockAdapter } from './chunk-MG5EAMZR.js';
2
- export { asInstance, asInstances, asSpy, assertMocked, captureArg, compareTestRuns, createFixture, createFixtureFactory, createMock, createSpyClass, describeDuplicateCopies, diffByField, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, getPackageCopies, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resizeEntry, setEmissionTimeout, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './chunk-ZBVBJFNW.js';
2
+ export { asInstance, asInstances, asSpy, assertMocked, captureArg, compareTestRuns, createFixture, createFixtureFactory, createMock, createSpyClass, describeDuplicateCopies, diffByField, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, getPackageCopies, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resizeEntry, setEmissionTimeout, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './chunk-IKH4OTMV.js';
3
3
  export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, restoreMockedProps } from './chunk-R4EWAG7Y.js';
4
4
  export { autoMocked, clearAutoSpy, createAutoMock, createSpyFromClass, resetAutoSpy } from './chunk-7YTPHYP7.js';
5
5
  export { createFunctionSpy, errorHandler } from './chunk-3AWKPZCE.js';
package/dist/rxjs.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Observable, ReplaySubject } from 'rxjs';
2
- import { V as ValueConfig } from './types-it6CnDkI.js';
3
- export { A as AddObservableSpyMethods, b as CompleteValueConfig, E as ErrorValueConfig, N as NextValueConfig, c as ValueConfigPerCall } from './types-it6CnDkI.js';
2
+ import { V as ValueConfig } from './types-Br-Usge9.js';
3
+ export { A as AddObservableSpyMethods, b as CompleteValueConfig, E as ErrorValueConfig, N as NextValueConfig, c as ValueConfigPerCall } from './types-Br-Usge9.js';
4
4
  import 'vitest';
5
5
 
6
6
  /**
package/dist/rxjs.js CHANGED
@@ -40,11 +40,18 @@ function mergeSubjectWithDefaultValues(subject, valuesConfigs) {
40
40
  return true;
41
41
  }),
42
42
  // Map each remaining entry to its emission: a value, an error, or nothing.
43
+ //
44
+ // The guards test *presence* (`'value' in config`), and that is the whole check: an entry that
45
+ // carries the key is an emission whatever the value is. Adding `&& config.value` on top — which
46
+ // is what stood here — silently dropped `{ value: false }`, `{ value: 0 }`, `{ value: '' }` and
47
+ // `{ value: null }`, i.e. an ordinary boolean or counter stream. Nothing was emitted, nothing
48
+ // was reported, and the symptom arrived a test away as a timed-out `expectEmission` or as a
49
+ // component still holding its initial state.
43
50
  concatMap((config) => {
44
- if (isNextValueConfig(config) && config.value) {
51
+ if (isNextValueConfig(config)) {
45
52
  return config.delay ? of(config.value).pipe(delay(config.delay)) : of(config.value);
46
53
  }
47
- if (isErrorConfig(config) && config.errorValue) {
54
+ if (isErrorConfig(config)) {
48
55
  return config.delay ? timer(config.delay).pipe(switchMap(() => throwError(() => config.errorValue))) : throwError(() => config.errorValue);
49
56
  }
50
57
  return EMPTY;
package/dist/setup.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { vi } from 'vitest';
2
- import { u as UnstubbedCallHandler } from './types-it6CnDkI.js';
3
- import { R as RestoreProp } from './prop-mock-IgCwv_40.js';
2
+ import { u as UnstubbedCallHandler } from './types-Br-Usge9.js';
3
+ import { R as RestoreProp } from './prop-mock-DyjtZVoA.js';
4
4
  export { d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-B1pqa-Sh.js';
5
5
  import 'rxjs';
6
6
 
@@ -348,6 +348,14 @@ interface SetupAutoSpyOptions {
348
348
  * and through those whole component trees. Turning this on prunes what each file added once the
349
349
  * file is over, and keeps what the file inherited. See {@link trackMockRegistry}, and
350
350
  * {@link keepMockRegistered} for the one case the split gets wrong on its own.
351
+ *
352
+ * It also guards the mocks it keeps. A registered mock is reachable by `vi.resetAllMocks()` as
353
+ * well as by `vi.clearAllMocks()`, and `mockReset` puts an implementation back only when it was
354
+ * passed to `vi.fn(implementation)` — a chained `.mockReturnValue(…)` or `.mockReturnThis()` is
355
+ * simply lost. With `isolate: false` that surfaces as a failure in a later file, inside
356
+ * application code, blaming a component for a shared double some other spec reset. The
357
+ * implementation each long-lived mock carried when it was classified is therefore remembered and
358
+ * put back before a test that has lost it. See {@link restoreLongLivedImplementations}.
351
359
  */
352
360
  pruneMockRegistry?: boolean;
353
361
  /**
@@ -573,6 +581,17 @@ declare function captureMockRegistry(): Set<unknown> | undefined;
573
581
  * ```
574
582
  */
575
583
  declare function keepMockRegistered<T>(mock: T): T;
584
+ /**
585
+ * Put back the implementation of every long-lived mock that has lost one, and report how many.
586
+ *
587
+ * The repair for a `vi.resetAllMocks()` — or a `mockReset: true` — reaching across files: it walks
588
+ * only the mocks that carried an implementation when they were classified, and only replaces one
589
+ * that is now missing, so a mock a test deliberately re-implements is left as the test left it.
590
+ *
591
+ * Installed on `beforeEach` by {@link trackMockRegistry}; call it directly to repair at some other
592
+ * moment.
593
+ */
594
+ declare function restoreLongLivedImplementations(): number;
576
595
  /**
577
596
  * Mark everything currently in the registry as long-lived.
578
597
  *
@@ -747,4 +766,4 @@ declare function restoreTimerGlobals(): void;
747
766
  /** The names this module watches — exported for the diagnostics that report what went missing. */
748
767
  declare function getWatchedTimerGlobals(): string[];
749
768
 
750
- export { BLOCKED_FETCH_MESSAGE, BLOCKED_XHR_MESSAGE, type BlockNetworkOptions, type CountingClock, type CountingClockOptions, type DuplicateCopiesReaction, type FakeTimersConfig, type GlobalPatchReaction, type PerTestHandle, type RejectionHost, type SchedulerHost, type SetupAutoSpyOptions, type StopTrackingRejections, type StopTrackingTimers, type StrayRejection, type SystemTime, type XhrBlockMode, advanceTimers, blockNetwork, cancelStrayTimers, captureMockRegistry, countStrayRejections, countStrayTimers, flushStrayRejections, getMockRegistrySize, getWatchedTimerGlobals, guardGlobalPatches, installPerTest, keepMockRegistered, keepRegisteredMocks, mockNow, mockSystemTime, pruneMockRegistry, registerFocusMatchers, resetMockRegistryTracking, restoreTimerGlobals, setupAutoSpy, setupFakeTimers, trackMockRegistry, trackStrayRejections, trackStrayTimers, useCountingClock, withSystemTime };
769
+ export { BLOCKED_FETCH_MESSAGE, BLOCKED_XHR_MESSAGE, type BlockNetworkOptions, type CountingClock, type CountingClockOptions, type DuplicateCopiesReaction, type FakeTimersConfig, type GlobalPatchReaction, type PerTestHandle, type RejectionHost, type SchedulerHost, type SetupAutoSpyOptions, type StopTrackingRejections, type StopTrackingTimers, type StrayRejection, type SystemTime, type XhrBlockMode, advanceTimers, blockNetwork, cancelStrayTimers, captureMockRegistry, countStrayRejections, countStrayTimers, flushStrayRejections, getMockRegistrySize, getWatchedTimerGlobals, guardGlobalPatches, installPerTest, keepMockRegistered, keepRegisteredMocks, mockNow, mockSystemTime, pruneMockRegistry, registerFocusMatchers, resetMockRegistryTracking, restoreLongLivedImplementations, restoreTimerGlobals, setupAutoSpy, setupFakeTimers, trackMockRegistry, trackStrayRejections, trackStrayTimers, useCountingClock, withSystemTime };
package/dist/setup.js CHANGED
@@ -205,9 +205,32 @@ ${describeHookTimeout(timeouts)}`);
205
205
  var registry;
206
206
  var captureAttempted = false;
207
207
  var longLived = /* @__PURE__ */ new WeakSet();
208
+ var rememberedImplementations = [];
209
+ var implementationsChecked = /* @__PURE__ */ new WeakSet();
208
210
  function isWeakKey(value) {
209
211
  return typeof value === "function" || typeof value === "object" && value !== null;
210
212
  }
213
+ function isMockImplementation(value) {
214
+ return typeof value === "function";
215
+ }
216
+ function hasImplementationControls(value) {
217
+ const getter = Reflect.get(value, "getMockImplementation");
218
+ const setter = Reflect.get(value, "mockImplementation");
219
+ return typeof getter === "function" && typeof setter === "function";
220
+ }
221
+ function rememberImplementation(mock) {
222
+ if (implementationsChecked.has(mock)) {
223
+ return;
224
+ }
225
+ implementationsChecked.add(mock);
226
+ if (!hasImplementationControls(mock)) {
227
+ return;
228
+ }
229
+ const implementation = mock.getMockImplementation();
230
+ if (isMockImplementation(implementation)) {
231
+ rememberedImplementations.push({ mock, implementation });
232
+ }
233
+ }
211
234
  function captureMockRegistry() {
212
235
  if (captureAttempted) {
213
236
  return registry;
@@ -238,9 +261,20 @@ function captureMockRegistry() {
238
261
  function keepMockRegistered(mock) {
239
262
  if (isWeakKey(mock)) {
240
263
  longLived.add(mock);
264
+ rememberImplementation(mock);
241
265
  }
242
266
  return mock;
243
267
  }
268
+ function restoreLongLivedImplementations() {
269
+ let restored = 0;
270
+ for (const remembered of rememberedImplementations) {
271
+ if (remembered.mock.getMockImplementation() === void 0) {
272
+ remembered.mock.mockImplementation(remembered.implementation);
273
+ restored += 1;
274
+ }
275
+ }
276
+ return restored;
277
+ }
244
278
  function keepRegisteredMocks() {
245
279
  registry?.forEach((mock) => {
246
280
  keepMockRegistered(mock);
@@ -264,6 +298,9 @@ function trackMockRegistry() {
264
298
  captureMockRegistry();
265
299
  keepRegisteredMocks();
266
300
  });
301
+ beforeEach(() => {
302
+ restoreLongLivedImplementations();
303
+ });
267
304
  afterAll(() => {
268
305
  pruneMockRegistry();
269
306
  });
@@ -275,6 +312,8 @@ function resetMockRegistryTracking() {
275
312
  registry = void 0;
276
313
  captureAttempted = false;
277
314
  longLived = /* @__PURE__ */ new WeakSet();
315
+ rememberedImplementations = [];
316
+ implementationsChecked = /* @__PURE__ */ new WeakSet();
278
317
  }
279
318
 
280
319
  // src/lib/network-stub.ts
@@ -829,4 +868,4 @@ function registerFocusMatchers() {
829
868
  }
830
869
  useVitestAdapter();
831
870
 
832
- export { BLOCKED_FETCH_MESSAGE, BLOCKED_XHR_MESSAGE, advanceTimers, blockNetwork, cancelStrayTimers, captureMockRegistry, countStrayRejections, countStrayTimers, flushStrayRejections, getMockRegistrySize, getWatchedTimerGlobals, guardGlobalPatches, installPerTest, keepMockRegistered, keepRegisteredMocks, mockNow, mockSystemTime, pruneMockRegistry, registerFocusMatchers, resetMockRegistryTracking, restoreTimerGlobals, setupAutoSpy, setupFakeTimers, trackMockRegistry, trackStrayRejections, trackStrayTimers, useCountingClock, withSystemTime };
871
+ export { BLOCKED_FETCH_MESSAGE, BLOCKED_XHR_MESSAGE, advanceTimers, blockNetwork, cancelStrayTimers, captureMockRegistry, countStrayRejections, countStrayTimers, flushStrayRejections, getMockRegistrySize, getWatchedTimerGlobals, guardGlobalPatches, installPerTest, keepMockRegistered, keepRegisteredMocks, mockNow, mockSystemTime, pruneMockRegistry, registerFocusMatchers, resetMockRegistryTracking, restoreLongLivedImplementations, restoreTimerGlobals, setupAutoSpy, setupFakeTimers, trackMockRegistry, trackStrayRejections, trackStrayTimers, useCountingClock, withSystemTime };
package/dist/svelte.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { d as AccessorKeysOf, e as AddAccessorsSpies, f as AddCalledWithObservable, g as AddCalledWithPromise, h as AddCalledWithSpyMethods, A as AddObservableSpyMethods, i as AddPromiseSpyMethods, j as AddSpyMethodsByReturnTypes, k as AddVoidReturnHelpers, a as ClassSpyConfiguration, C as ClassType, b as CompleteValueConfig, D as DeepMockProxy, l as DeepPartial, E as ErrorValueConfig, F as Func, M as MethodReturns, m as Mutable, N as NextValueConfig, O as OnlyMethodKeysOf, n as OnlyObservablePropsOf, o as OnlyPropsOf, p as Overload, q as Overloads, P as PropStubValue, S as Spy, r as SpyDisposable, s as SpyOptions, t as StrictSpyConfiguration, U as UnstubbedCall, u as UnstubbedCallHandler, V as ValueConfig, c as ValueConfigPerCall, W as WithMockReturnValue } from './types-it6CnDkI.js';
1
+ export { d as AccessorKeysOf, e as AddAccessorsSpies, f as AddCalledWithObservable, g as AddCalledWithPromise, h as AddCalledWithSpyMethods, A as AddObservableSpyMethods, i as AddPromiseSpyMethods, j as AddSpyMethodsByReturnTypes, k as AddVoidReturnHelpers, a as ClassSpyConfiguration, C as ClassType, b as CompleteValueConfig, D as DeepMockProxy, l as DeepPartial, E as ErrorValueConfig, F as Func, M as MethodReturns, m as Mutable, N as NextValueConfig, O as OnlyMethodKeysOf, n as OnlyObservablePropsOf, o as OnlyPropsOf, p as Overload, q as Overloads, P as PropStubValue, S as Spy, r as SpyDisposable, s as SpyOptions, t as StrictSpyConfiguration, U as UnstubbedCall, u as UnstubbedCallHandler, V as ValueConfig, c as ValueConfigPerCall, W as WithMockReturnValue } from './types-Br-Usge9.js';
2
2
  export { ArgCaptor, AsInstances, AssertMockedOptions, ConstructorMock, ConstructorSpy, FixtureFactory, FlushUntilOptions, IntersectionObserverStubOptions, MediaElementState, MediaElementStub, MediaElementStubOptions, MockDeepOptions, ModuleNamespace, ModuleNamespaceOptions, MutationRecordInit, ObserverGlobal, ObserverInstance, ObserverStub, ObserverStubOptions, ResizeEntryRect, TestRunComparison, TestRunReport, TestRunSummary, asInstance, asInstances, asSpy, assertMocked, captureArg, clearAutoSpy, compareTestRuns, createFixture, createFixtureFactory, createFunctionSpy, createMock, createSpyClass, createSpyFromClass, diffByField, errorHandler, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resetAutoSpy, resizeEntry, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './bun.js';
3
- export { A as AutoMockConfiguration, C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, c as autoMocked, d as createAutoMock, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-CuGjE0YR.js';
4
- export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-IgCwv_40.js';
3
+ export { A as AutoMockConfiguration, C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, c as autoMocked, d as createAutoMock, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-DMx5uXie.js';
4
+ export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-DyjtZVoA.js';
5
5
  export { d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-B1pqa-Sh.js';
6
6
  import 'rxjs';
7
7
  import 'vitest';
package/dist/svelte.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { vitestMockAdapter } from './chunk-MG5EAMZR.js';
2
- export { asInstance, asInstances, asSpy, assertMocked, captureArg, compareTestRuns, createFixture, createFixtureFactory, createMock, createSpyClass, describeDuplicateCopies, diffByField, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, getPackageCopies, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resizeEntry, setEmissionTimeout, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './chunk-ZBVBJFNW.js';
2
+ export { asInstance, asInstances, asSpy, assertMocked, captureArg, compareTestRuns, createFixture, createFixtureFactory, createMock, createSpyClass, describeDuplicateCopies, diffByField, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, getPackageCopies, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resizeEntry, setEmissionTimeout, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './chunk-IKH4OTMV.js';
3
3
  export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, restoreMockedProps } from './chunk-R4EWAG7Y.js';
4
4
  export { autoMocked, clearAutoSpy, createAutoMock, createSpyFromClass, resetAutoSpy } from './chunk-7YTPHYP7.js';
5
5
  export { createFunctionSpy, errorHandler } from './chunk-3AWKPZCE.js';
@@ -1,4 +1,4 @@
1
- import { C as ClassType, S as Spy } from './types-it6CnDkI.js';
1
+ import { C as ClassType, S as Spy } from './types-Br-Usge9.js';
2
2
 
3
3
  /**
4
4
  * The provider shape Angular and NestJS agree on: `{ provide, useFactory }`, with the dependency
@@ -1,5 +1,5 @@
1
1
  import { Observable, Subject } from 'rxjs';
2
- import { Mock } from 'vitest';
2
+ import { Mock, MockInstance } from 'vitest';
3
3
 
4
4
  /**
5
5
  * Public type surface (mirrors `@hirez_io/auto-spies-core`).
@@ -177,8 +177,19 @@ interface AddVoidReturnHelpers {
177
177
  * `ReturnType extends Promise<…>` distributes over the `infer`-bound parameter, and distributing
178
178
  * over `never` yields `never` — the same collapse by a different route, for a method whose
179
179
  * return type does resolve, to `never`.
180
+ * 3. **The mock surface is `MockInstance`, not `Mock`.** `Mock` is `Mock<Procedure>` here, and
181
+ * `Procedure` is `(...args: any[]) => any` — so it contributed a call signature that swallows
182
+ * anything. An intersection accepts a call matching *either* member, so on a double of
183
+ * `read(key: string)` all three of `read(1)`, `read('ok', 'extra')` and `read()` compiled, none
184
+ * of them compiles on the real instance, and the spec stayed green while calling the double the
185
+ * way production code never could. `MockInstance` is the same surface *without* the call and
186
+ * construct signatures, so the only call signature left is `Method`'s own. Nothing about
187
+ * configuring the double changed: `MockInstance` defaults to `Procedure` too, so
188
+ * `mockReturnValue` / `mockImplementation` stay as lenient as they were. Side effect worth
189
+ * knowing: with one call signature instead of two, `expectTypeOf(spy.method).parameters` and
190
+ * `.returns` resolve instead of collapsing to `never`.
180
191
  */
181
- type AddSpyMethodsByReturnTypes<Method extends Func> = Method & Mock & (Method extends (...args: any[]) => infer ReturnType ? [ReturnType] extends [Promise<infer P>] ? AddCalledWithPromise<Method, P> & AddPromiseSpyMethods<P> : [ReturnType] extends [Observable<infer O>] ? AddCalledWithObservable<Method, O> & AddObservableSpyMethods<O> : [ReturnType] extends [void] ? AddCalledWithSpyMethods<Method> & AddVoidReturnHelpers : AddCalledWithSpyMethods<Method> : AddCalledWithSpyMethods<Method>);
192
+ type AddSpyMethodsByReturnTypes<Method extends Func> = Method & MockInstance & (Method extends (...args: any[]) => infer ReturnType ? [ReturnType] extends [Promise<infer P>] ? AddCalledWithPromise<Method, P> & AddPromiseSpyMethods<P> : [ReturnType] extends [Observable<infer O>] ? AddCalledWithObservable<Method, O> & AddObservableSpyMethods<O> : [ReturnType] extends [void] ? AddCalledWithSpyMethods<Method> & AddVoidReturnHelpers : AddCalledWithSpyMethods<Method> : AddCalledWithSpyMethods<Method>);
182
193
  /**
183
194
  * Every call signature of `F`, in declaration order.
184
195
  *
package/dist/vue.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { S as Spy, C as ClassType, a as ClassSpyConfiguration, O as OnlyMethodKeysOf } from './types-it6CnDkI.js';
2
- export { d as AccessorKeysOf, e as AddAccessorsSpies, f as AddCalledWithObservable, g as AddCalledWithPromise, h as AddCalledWithSpyMethods, A as AddObservableSpyMethods, i as AddPromiseSpyMethods, j as AddSpyMethodsByReturnTypes, k as AddVoidReturnHelpers, b as CompleteValueConfig, D as DeepMockProxy, l as DeepPartial, E as ErrorValueConfig, F as Func, M as MethodReturns, m as Mutable, N as NextValueConfig, n as OnlyObservablePropsOf, o as OnlyPropsOf, p as Overload, q as Overloads, P as PropStubValue, r as SpyDisposable, s as SpyOptions, t as StrictSpyConfiguration, U as UnstubbedCall, u as UnstubbedCallHandler, V as ValueConfig, c as ValueConfigPerCall, W as WithMockReturnValue } from './types-it6CnDkI.js';
1
+ import { S as Spy, C as ClassType, a as ClassSpyConfiguration, O as OnlyMethodKeysOf } from './types-Br-Usge9.js';
2
+ export { d as AccessorKeysOf, e as AddAccessorsSpies, f as AddCalledWithObservable, g as AddCalledWithPromise, h as AddCalledWithSpyMethods, A as AddObservableSpyMethods, i as AddPromiseSpyMethods, j as AddSpyMethodsByReturnTypes, k as AddVoidReturnHelpers, b as CompleteValueConfig, D as DeepMockProxy, l as DeepPartial, E as ErrorValueConfig, F as Func, M as MethodReturns, m as Mutable, N as NextValueConfig, n as OnlyObservablePropsOf, o as OnlyPropsOf, p as Overload, q as Overloads, P as PropStubValue, r as SpyDisposable, s as SpyOptions, t as StrictSpyConfiguration, U as UnstubbedCall, u as UnstubbedCallHandler, V as ValueConfig, c as ValueConfigPerCall, W as WithMockReturnValue } from './types-Br-Usge9.js';
3
3
  export { ArgCaptor, AsInstances, AssertMockedOptions, ConstructorMock, ConstructorSpy, FixtureFactory, FlushUntilOptions, IntersectionObserverStubOptions, MediaElementState, MediaElementStub, MediaElementStubOptions, MockDeepOptions, ModuleNamespace, ModuleNamespaceOptions, MutationRecordInit, ObserverGlobal, ObserverInstance, ObserverStub, ObserverStubOptions, ResizeEntryRect, TestRunComparison, TestRunReport, TestRunSummary, asInstance, asInstances, asSpy, assertMocked, captureArg, clearAutoSpy, compareTestRuns, createFixture, createFixtureFactory, createFunctionSpy, createMock, createSpyClass, createSpyFromClass, diffByField, errorHandler, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resetAutoSpy, resizeEntry, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './bun.js';
4
- export { A as AutoMockConfiguration, C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, c as autoMocked, d as createAutoMock, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-CuGjE0YR.js';
5
- export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-IgCwv_40.js';
4
+ export { A as AutoMockConfiguration, C as CallbackSubscribable, E as EmissionObserver, a as EmissionOptions, b as EmissionSource, S as SubscribableLike, c as autoMocked, d as createAutoMock, e as expectCompletion, f as expectEmission, g as expectEmissions, h as expectError, i as expectNoEmission, s as setEmissionTimeout } from './expect-emission-DMx5uXie.js';
5
+ export { A as AccessorImplementations, R as RestoreProp, c as countMockedProps, m as mockAccessorsProp, a as mockReadonlyProp, b as mockReadonlyPropGetter, d as mockValueProp, r as restoreMockedProps } from './prop-mock-DyjtZVoA.js';
6
6
  export { d as describeDuplicateCopies, g as getPackageCopies } from './package-identity-B1pqa-Sh.js';
7
7
  import 'rxjs';
8
8
  import 'vitest';
package/dist/vue.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { vitestMockAdapter } from './chunk-MG5EAMZR.js';
2
- export { asInstance, asInstances, asSpy, assertMocked, captureArg, compareTestRuns, createFixture, createFixtureFactory, createMock, createSpyClass, describeDuplicateCopies, diffByField, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, getPackageCopies, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resizeEntry, setEmissionTimeout, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './chunk-ZBVBJFNW.js';
2
+ export { asInstance, asInstances, asSpy, assertMocked, captureArg, compareTestRuns, createFixture, createFixtureFactory, createMock, createSpyClass, describeDuplicateCopies, diffByField, expectCompletion, expectEmission, expectEmissions, expectError, expectNoEmission, flushEventLoop, flushEventLoopUntil, formatTestRunComparison, getPackageCopies, intersectionEntry, mockConstructor, mockDeep, moduleNamespace, mutationRecord, narrow, resizeEntry, setEmissionTimeout, settleDynamicImport, stubAbortController, stubConstructor, stubIntersectionObserver, stubMediaElement, stubMutationObserver, stubObserver, stubResizeObserver, summarizeTestRun, withOverrides } from './chunk-IKH4OTMV.js';
3
3
  export { countMockedProps, mockAccessorsProp, mockReadonlyProp, mockReadonlyPropGetter, mockValueProp, restoreMockedProps } from './chunk-R4EWAG7Y.js';
4
4
  import { createSpyFromClass } from './chunk-7YTPHYP7.js';
5
5
  export { autoMocked, clearAutoSpy, createAutoMock, createSpyFromClass, resetAutoSpy } from './chunk-7YTPHYP7.js';
@@ -1,7 +1,7 @@
1
1
  import { InjectionToken, Injector, ProviderToken, Provider, Type, InputSignalWithTransform, InputSignal, ModelSignal, EnvironmentProviders, EffectRef } from '@angular/core';
2
- import { A as AutoMockConfiguration } from './expect-emission-CuGjE0YR.js';
3
- import { S as Spy, C as ClassType, s as SpyOptions, a as ClassSpyConfiguration, O as OnlyMethodKeysOf, l as DeepPartial } from './types-it6CnDkI.js';
4
- import './prop-mock-IgCwv_40.js';
2
+ import { A as AutoMockConfiguration } from './expect-emission-DMx5uXie.js';
3
+ import { S as Spy, C as ClassType, s as SpyOptions, a as ClassSpyConfiguration, O as OnlyMethodKeysOf, l as DeepPartial } from './types-Br-Usge9.js';
4
+ import './prop-mock-DyjtZVoA.js';
5
5
  import { ComponentFixture } from '@angular/core/testing';
6
6
 
7
7
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest-auto-spy",
3
- "version": "3.12.1",
3
+ "version": "3.13.0",
4
4
  "description": "Auto-generate fully-typed test spies from a class — across Vitest, Bun and node:test, with Angular/NestJS/React/Vue/Svelte recipes. Drop-in replacement for jest-auto-spies.",
5
5
  "keywords": [
6
6
  "auto-mock",