File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export interface TestingOptions {
46
46
47
47
/**
48
48
* Function used to create a spy for actions and `$patch()`. Pre-configured
49
- * with `jest.fn()` in jest projects or `vitest .fn()` in vitest projects.
49
+ * with `jest.fn()` in jest projects or `vi .fn()` in vitest projects.
50
50
*/
51
51
createSpy ?: ( fn ?: ( ...args : any [ ] ) => any ) => ( ...args : any [ ] ) => any
52
52
}
@@ -60,6 +60,12 @@ export interface TestingPinia extends Pinia {
60
60
app : App
61
61
}
62
62
63
+ declare var vi :
64
+ | undefined
65
+ | {
66
+ fn : ( fn ?: ( ...args : any [ ] ) => any ) => ( ...args : any [ ] ) => any
67
+ }
68
+
63
69
/**
64
70
* Creates a pinia instance designed for unit tests that **requires mocking**
65
71
* the stores. By default, **all actions are mocked** and therefore not
@@ -92,7 +98,7 @@ export function createTestingPinia({
92
98
const createSpy =
93
99
_createSpy ||
94
100
( typeof jest !== 'undefined' && jest . fn ) ||
95
- ( typeof vitest !== 'undefined' && vitest . fn )
101
+ ( typeof vi !== 'undefined' && vi . fn )
96
102
/* istanbul ignore if */
97
103
if ( ! createSpy ) {
98
104
throw new Error ( 'You must configure the `createSpy` option.' )
You can’t perform that action at this time.
0 commit comments