File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change
1
+ import { vi } from 'vitest' ;
2
+
3
+ // Mock the keytar module
4
+ vi . mock ( 'keytar' , ( ) => ( {
5
+ getPassword : vi . fn ( ) . mockResolvedValue ( 'mock-password' ) ,
6
+ setPassword : vi . fn ( ) . mockResolvedValue ( undefined ) ,
7
+ deletePassword : vi . fn ( ) . mockResolvedValue ( true ) ,
8
+ findPassword : vi . fn ( ) . mockResolvedValue ( 'mock-password' ) ,
9
+ findCredentials : vi . fn ( ) . mockResolvedValue ( [ { account : 'mock-account' , password : 'mock-password' } ] ) ,
10
+ } ) ) ;
Original file line number Diff line number Diff line change @@ -15,8 +15,6 @@ export default defineConfig({
15
15
} ,
16
16
include : [ '**/*.test.ts' ] ,
17
17
exclude : [ 'node_modules' , 'dist' ] ,
18
- alias : {
19
- keytar : process . env . CI ? './test/mocks/keytar.ts' : 'keytar' ,
20
- } ,
18
+ setupFiles : [ './test/setup.ts' ] ,
21
19
} ,
22
20
} ) ;
You can’t perform that action at this time.
0 commit comments