File tree Expand file tree Collapse file tree 2 files changed +16
-18
lines changed Expand file tree Collapse file tree 2 files changed +16
-18
lines changed Original file line number Diff line number Diff line change 1
1
/// <reference types="vite/client" />
2
+
3
+ // This is needed to properly support Vitest testing with jest-dom matchers.
4
+ // Types for jest-dom are not recognized automatically and Typescript complains
5
+ // about missing types e.g. when using `toBeInTheDocument` and other matchers.
6
+ // Reference: https://github.com/testing-library/jest-dom/issues/546#issuecomment-1889884843
7
+ import '@testing-library/jest-dom' ;
Original file line number Diff line number Diff line change 11
11
{
12
12
"compilerOptions" : {
13
13
"module" : " esnext" ,
14
- // Needed because this is used as a project reference.
15
14
"composite" : true ,
16
15
"target" : " esnext" ,
17
- // We're bundling all code in the end so this is the most appropriate option,
18
- // it's also important for autocomplete to work properly.
19
16
"moduleResolution" : " bundler" ,
20
- // JSX support
21
17
"jsx" : " preserve" ,
22
18
"strict" : true ,
23
- // Allow default imports.
24
19
"esModuleInterop" : true ,
25
- "lib" : [" dom" , " dom.iterable" , " esnext" ],
20
+ "isolatedModules" : true ,
21
+ "moduleDetection" : " force" ,
22
+ "lib" : [
23
+ " dom" ,
24
+ " dom.iterable" ,
25
+ " esnext"
26
+ ],
26
27
"skipLibCheck" : true ,
27
28
"allowJs" : true ,
28
- "typeRoots" : [
29
- // This is needed to properly support Vitest testing with jest-dom matchers.
30
- // Types for jest-dom are not recognized automatically and Typescript complains
31
- // about missing types e.g. when using `toBeInTheDocument` and other matchers.
32
- " node_modules/@testing-library" ,
33
- // Specifying type roots overrides the default behavior of looking at the
34
- // node_modules/@types folder so we had to list it explicitly.
35
- // Source 1: https://www.typescriptlang.org/tsconfig#typeRoots
36
- // Source 2: https://github.com/testing-library/jest-dom/issues/546#issuecomment-1889884843
37
- " node_modules/@types"
38
- ],
39
29
"outDir" : " .wasp/out/user"
40
30
},
41
- "include" : [" src" ]
31
+ "include" : [
32
+ " src"
33
+ ]
42
34
}
You can’t perform that action at this time.
0 commit comments