Skip to content

Commit 28a334c

Browse files
committed
fix: remove unused option for spying
1 parent 5be7026 commit 28a334c

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/autoSpy.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ export interface RouterMockSpyOptions {
4848
* Resets a spy but keeps it active.
4949
*/
5050
reset: (spy: _InferSpyType) => void
51-
52-
/**
53-
* Restores the original function given to the spy.
54-
*/
55-
restore: (spy: _InferSpyType) => void
5651
}
5752

5853
/**

src/router.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,19 @@ export interface RouterMockOptions extends Partial<RouterOptions> {
122122
noUndeclaredRoutes?: boolean
123123

124124
/**
125-
* By default the mock will use sinon or jest support to create and restore spies.
126-
* This option allows to use a different testing framework,
127-
* by providing a method to create spies, and one to restore them.
128-
* For example, with vitest:
129-
* ```
125+
* By default the mock will use sinon, jest, or vitest support to create and reset spies. This option allows to use
126+
* any testing library with its own spies, by providing a method to create spies, and one to reset them them. Check
127+
* the `RouterMockSpy` type to add your own type.
128+
*
129+
* @example
130+
*
131+
* For example, with vitest with `globals: false`:
132+
*
133+
* ```ts
130134
* const router = createRouterMock({
131135
* spy: {
132136
* create: fn => vi.fn(fn),
133-
* restore: spy => () => spy.restore()
137+
* reset: spy => spy.mockReset()
134138
* }
135139
* });
136140
* ```

0 commit comments

Comments
 (0)