File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,6 @@ export interface RouterMockSpyOptions {
48
48
* Resets a spy but keeps it active.
49
49
*/
50
50
reset : ( spy : _InferSpyType ) => void
51
-
52
- /**
53
- * Restores the original function given to the spy.
54
- */
55
- restore : ( spy : _InferSpyType ) => void
56
51
}
57
52
58
53
/**
Original file line number Diff line number Diff line change @@ -122,15 +122,19 @@ export interface RouterMockOptions extends Partial<RouterOptions> {
122
122
noUndeclaredRoutes ?: boolean
123
123
124
124
/**
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
130
134
* const router = createRouterMock({
131
135
* spy: {
132
136
* create: fn => vi.fn(fn),
133
- * restore : spy => () => spy.restore ()
137
+ * reset : spy => spy.mockReset ()
134
138
* }
135
139
* });
136
140
* ```
You can’t perform that action at this time.
0 commit comments