-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(jest): allow enabling Jest global types through "types": ["jest"]
in tsconfig.json
#12856
Changes from all commits
ed0b797
ed47a17
075268f
fc87c17
a37c2cd
c642ac6
00c2452
973955c
a0fa6ed
ef6d981
048c18c
cb3ef9f
ea84f93
998e02a
dd87ffc
c734ec5
7a9c054
8475aef
a8d883d
a65cfee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,8 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let’s Hm.. Just noticed that |
||
"compilerOptions": { | ||
"noEmit": true, | ||
|
||
"target": "es2017", | ||
"module": "commonjs", | ||
"lib": ["dom", "es2017"], | ||
"strict": true, | ||
|
||
/* Additional Checks */ | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true, | ||
|
||
/* Module Resolution Options */ | ||
"moduleResolution": "node", | ||
"isolatedModules": true, | ||
"importsNotUsedAsValues": "error", | ||
"resolveJsonModule": true | ||
} | ||
"composite": false, | ||
"types": ["jest"] | ||
}, | ||
"include": ["../**/*"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"compilerOptions": { | ||
"strict": true | ||
"strict": true, | ||
"types": ["jest"] | ||
}, | ||
"include": ["./**/*"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"jsx": "react-jsx" | ||
"jsx": "react-jsx", | ||
"types": ["jest"] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Also here I have to extend the root |
||
"extends": "../../../../tsconfig.json", | ||
"compilerOptions": { | ||
"composite": false, | ||
"esModuleInterop": true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need this? (applies to all) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some tests needs it. For example, commenting out My idea was to use the same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A separate PR making it unneeded would be awesome, but shouldn't clutter up this pr |
||
"rootDir": "../", | ||
"types": ["jest"] | ||
}, | ||
"include": ["../**/*"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../../../tsconfig.json", | ||
"compilerOptions": { | ||
"composite": false, | ||
"esModuleInterop": true, | ||
"rootDir": "../", | ||
"types": ["jest"] | ||
}, | ||
"include": ["../**/*"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../../../tsconfig.json", | ||
"compilerOptions": { | ||
"composite": false, | ||
"esModuleInterop": true, | ||
"rootDir": "../", | ||
"types": ["jest"] | ||
}, | ||
"include": ["../**/*"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../../../tsconfig.json", | ||
"compilerOptions": { | ||
"composite": false, | ||
"esModuleInterop": true, | ||
"rootDir": "../", | ||
"types": ["jest"] | ||
}, | ||
"include": ["../**/*"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../../../tsconfig.json", | ||
"compilerOptions": { | ||
"composite": false, | ||
"esModuleInterop": true, | ||
"rootDir": "../", | ||
"types": ["jest"] | ||
}, | ||
"include": ["../**/*"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../../../tsconfig.json", | ||
"compilerOptions": { | ||
"composite": false, | ||
"esModuleInterop": true, | ||
"rootDir": "../", | ||
"types": ["jest"] | ||
}, | ||
"include": ["../**/*"] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This page can have more TS examples, of course. I just wanted to remove this old pain.