Skip to content

Commit 8a62d98

Browse files
authored
chore(type tests): bump jest-runner-tsd (#12299)
* chore: bump jest-runner-tsd * fix compiler config * fix @tsd/typescript version * improve setup * alternative setup
1 parent 7509d25 commit 8a62d98

File tree

64 files changed

+198
-256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+198
-256
lines changed

.eslintrc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ module.exports = {
234234
},
235235
},
236236
{
237-
files: ['**/__typechecks__/**', '*.md'],
237+
files: ['**/__typetests__/**', '*.md'],
238238
rules: {
239239
'jest/no-focused-tests': 'off',
240240
'jest/no-identical-title': 'off',
@@ -303,7 +303,7 @@ module.exports = {
303303
devDependencies: [
304304
'**/__mocks__/**',
305305
'**/__tests__/**',
306-
'**/__typechecks__/**',
306+
'**/__typetests__/**',
307307
'**/?(*.)(spec|test).js?(x)',
308308
'scripts/**',
309309
'babel.config.js',

jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = {
3636
],
3737
testPathIgnorePatterns: [
3838
'/__arbitraries__/',
39-
'/__typechecks__/',
39+
'/__typetests__/',
4040
'/node_modules/',
4141
'/examples/',
4242
'/e2e/.*/__tests__',

jest.config.types.js renamed to jest.config.tsd.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ module.exports = {
1717
modulePathIgnorePatterns,
1818
roots: ['<rootDir>/packages'],
1919
runner: 'jest-runner-tsd',
20-
testMatch: ['**/__typechecks__/**/*.ts'],
20+
testMatch: ['**/__typetests__/**/*.ts'],
2121
};

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@jest/globals": "workspace:*",
1515
"@jest/test-utils": "workspace:*",
1616
"@tsconfig/node10": "^1.0.8",
17+
"@tsd/typescript": "~4.1.5",
1718
"@types/babel__core": "^7.0.0",
1819
"@types/babel__generator": "^7.0.0",
1920
"@types/babel__template": "^7.0.0",
@@ -55,7 +56,7 @@
5556
"jest-changed-files": "workspace:*",
5657
"jest-junit": "^13.0.0",
5758
"jest-mock": "workspace:*",
58-
"jest-runner-tsd": "^1.1.0",
59+
"jest-runner-tsd": "^2.0.0",
5960
"jest-silent-reporter": "^0.5.0",
6061
"jest-snapshot": "workspace:*",
6162
"jest-snapshot-serializer-raw": "^1.1.0",
@@ -102,7 +103,7 @@
102103
"lint:prettier": "prettier '**/*.{md,yml,yaml}' 'website/**/*.{css,js}' --write --ignore-path .gitignore",
103104
"lint:prettier:ci": "prettier '**/*.{md,yml,yaml}' 'website/**/*.{css,js}' --check --ignore-path .gitignore",
104105
"remove-examples": "node ./scripts/remove-examples.js",
105-
"test-types": "yarn jest --config jest.config.types.js",
106+
"test-types": "yarn jest --config jest.config.tsd.js",
106107
"test-ci": "yarn jest-coverage --color -i --config jest.config.ci.js && yarn test-leak && node ./scripts/mapCoverage.js && codecov",
107108
"test-ci-partial": "yarn test-ci-partial:parallel -i",
108109
"test-ci-partial:parallel": "yarn jest --color --config jest.config.ci.js",

packages/babel-jest/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
// TODO: include `babel-preset-jest` if it's ever in TS even though we don't care about its types
810
"references": [
911
{"path": "../jest-transform"},

packages/babel-plugin-jest-hoist/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"compilerOptions": {
44
"rootDir": "src",
55
"outDir": "build"
6-
}
6+
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"]
79
}

packages/diff-sequences/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"compilerOptions": {
44
"rootDir": "src",
55
"outDir": "build"
6-
}
6+
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"]
79
}

packages/expect/.npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
**/__mocks__/**
22
**/__tests__/**
3-
__typechecks__
3+
__typetests__
44
src
55
tsconfig.json
66
tsconfig.tsbuildinfo
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../../../tsconfig.json",
3+
"compilerOptions": {
4+
"noUnusedLocals": false,
5+
"noUnusedParameters": false,
6+
"skipLibCheck": true
7+
},
8+
"include": ["./**/*"]
9+
}

packages/expect/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-get-type"},
911
{"path": "../jest-matcher-utils"},

packages/jest-changed-files/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
78
"references": [{"path": "../jest-types"}]
89
}

packages/jest-circus/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"outDir": "build",
55
"rootDir": "src"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"],
79
"references": [
810
{"path": "../expect"},
911
{"path": "../jest-each"},

packages/jest-cli/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-config"},
911
{"path": "../jest-core"},

packages/jest-config/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"],
79
// TODO: This is missing `babel-jest`, `jest-jasmine2`, `jest-circus` and
810
// jest-test-sequencer, but that is just `require.resolve`d, so no real use
911
// for their types

packages/jest-console/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-message-util"},
911
{"path": "../jest-types"},

packages/jest-core/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-changed-files"},
911
{"path": "../jest-config"},

packages/jest-create-cache-key-function/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [{"path": "../jest-types"}, {"path": "../jest-util"}]
810
}

packages/jest-diff/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [
810
{"path": "../diff-sequences"},
911
{"path": "../jest-get-type"},

packages/jest-docblock/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"compilerOptions": {
44
"rootDir": "src",
55
"outDir": "build"
6-
}
6+
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"]
79
}

packages/jest-each/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-get-type"},
911
{"path": "../jest-types"},

packages/jest-environment-jsdom/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"outDir": "build",
55
"rootDir": "src"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-environment"},
911
{"path": "../jest-fake-timers"},

packages/jest-environment-node/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"outDir": "build",
55
"rootDir": "src"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-environment"},
911
{"path": "../jest-fake-timers"},

packages/jest-environment/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"rootDir": "src",
77
"outDir": "build"
88
},
9+
"include": ["./src/**/*"],
910
"references": [
1011
{"path": "../jest-fake-timers"},
1112
{"path": "../jest-mock"},

packages/jest-fake-timers/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-message-util"},
911
{"path": "../jest-mock"},

packages/jest-get-type/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"compilerOptions": {
44
"rootDir": "src",
55
"outDir": "build"
6-
}
6+
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"]
79
}

packages/jest-globals/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"rootDir": "src",
77
"outDir": "build"
88
},
9+
"include": ["./src/**/*"],
10+
"exclude": ["./**/__tests__/**/*"],
911
"references": [
1012
{"path": "../expect"},
1113
{"path": "../jest-environment"},

packages/jest-haste-map/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-regex-util"},
911
{"path": "../jest-serializer"},

packages/jest-jasmine2/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [
810
{"path": "../expect"},
911
{"path": "../jest-each"},

packages/jest-leak-detector/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [{"path": "../jest-get-type"}, {"path": "../pretty-format"}]
810
}

packages/jest-matcher-utils/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-diff"},
911
{"path": "../jest-get-type"},

packages/jest-message-util/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [{"path": "../jest-types"}, {"path": "../pretty-format"}]
810
}

packages/jest-mock/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [{"path": "../jest-types"}]
810
}

packages/jest-phabricator/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
78
"references": [
89
{
910
"path": "../jest-test-result"

packages/jest-regex-util/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"compilerOptions": {
44
"rootDir": "src",
55
"outDir": "build"
6-
}
6+
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"]
79
}

packages/jest-repl/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-config"},
911
{"path": "../jest-console"},

packages/jest-reporters/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-console"},
911
{"path": "../jest-haste-map"},

packages/jest-resolve-dependencies/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-haste-map"},
911
{"path": "../jest-regex-util"},

packages/jest-resolve/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-haste-map"},
911
{"path": "../jest-types"},

packages/jest-runner/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-console"},
911
{"path": "../jest-docblock"},

packages/jest-runtime/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"],
79
"references": [
810
{"path": "../jest-environment"},
911
{"path": "../jest-environment-node"},

packages/jest-serializer/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"compilerOptions": {
44
"rootDir": "src",
55
"outDir": "build"
6-
}
6+
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__tests__/**/*"]
79
}

packages/jest-snapshot/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"rootDir": "src",
55
"outDir": "build"
66
},
7+
"include": ["./src/**/*"],
8+
"exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"],
79
"references": [
810
{"path": "../expect"},
911
{"path": "../jest-diff"},

0 commit comments

Comments
 (0)