File tree 5 files changed +22
-20
lines changed
5 files changed +22
-20
lines changed Original file line number Diff line number Diff line change 26
26
{
27
27
"type" : " node" ,
28
28
"request" : " launch" ,
29
- "name" : " Jest Server Unit Tests" ,
30
- "program" : " ${workspaceFolder}/node_modules/.bin/jest" ,
31
- "args" : [
32
- " --runInBand" ,
33
- " --config" ,
34
- " ./tests/unit/jest.config.js" ,
35
- ],
36
- "cwd" : " ${workspaceFolder}/server" ,
37
- "console" : " integratedTerminal" ,
38
- "internalConsoleOptions" : " neverOpen" ,
29
+ "name" : " Debug Current Test File (ott-server)" ,
30
+ "autoAttachChildProcesses" : true ,
31
+ "skipFiles" : [" <node_internals>/**" , " **/node_modules/**" ],
32
+ "program" : " ${workspaceRoot}/node_modules/vitest/vitest.mjs" ,
33
+ "args" : [" run" , " ../${relativeFile}" ],
34
+ "cwd" : " ${workspaceRoot}/server" ,
35
+ "smartStep" : true ,
36
+ "console" : " integratedTerminal"
39
37
},
40
38
{
41
39
"name" : " Attach" ,
47
45
"type" : " pwa-node"
48
46
}
49
47
]
50
- }
48
+ }
Original file line number Diff line number Diff line change 3
3
"compilerOptions" : {
4
4
"target" : " es2018" ,
5
5
"baseUrl" : " ." ,
6
- "types" : [
7
- " jest" ,
8
- ],
9
6
"paths" : {
10
7
"@/*" : [
11
8
" src/*"
21
18
" tests/**/*.tsx"
22
19
],
23
20
"exclude" : [" node_modules" , " dist" , " ts-out" ]
24
- }
21
+ }
Original file line number Diff line number Diff line change @@ -142,7 +142,6 @@ describe("Room API", () => {
142
142
. expect ( "Content-Type" , / j s o n / )
143
143
. expect ( 404 ) ;
144
144
expect ( resp . body . success ) . toEqual ( false ) ;
145
- // @ts -expect-error I can't get typescript to acknowledge the custom matchers.
146
145
expect ( resp . body . error ) . toBeRoomNotFound ( ) ;
147
146
} ) ;
148
147
} ) ;
Original file line number Diff line number Diff line change
1
+ import type { Assertion , AsymmetricMatchersContaining } from "vitest" ;
2
+
3
+ interface OttMatchers < R = unknown > {
4
+ toBeRoomNotFound : ( ) => R ;
5
+ toBeUnknownError : ( ) => R ;
6
+ }
7
+
8
+ declare module "vitest" {
9
+ interface Assertion < T = any > extends OttMatchers < T > { }
10
+ interface AsymmetricMatchersContaining extends OttMatchers { }
11
+ }
Original file line number Diff line number Diff line change 15
15
"sourceMap" : true ,
16
16
"baseUrl" : " ." ,
17
17
"noImplicitThis" : true ,
18
- "types" : [
19
- " jest"
20
- ],
21
18
"outDir" : " ts-out" ,
22
19
"strictNullChecks" : true ,
23
20
"strictPropertyInitialization" : true ,
36
33
"ts-node" : {
37
34
"transpileOnly" : true
38
35
}
39
- }
36
+ }
You can’t perform that action at this time.
0 commit comments