Skip to content

Commit

Permalink
chore(type tests): bump jest-runner-tsd (#12299)
Browse files Browse the repository at this point in the history
* chore: bump jest-runner-tsd

* fix compiler config

* fix @tsd/typescript version

* improve setup

* alternative setup
  • Loading branch information
mrazauskas committed Feb 4, 2022
1 parent 7509d25 commit 8a62d98
Show file tree
Hide file tree
Showing 64 changed files with 198 additions and 256 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Expand Up @@ -234,7 +234,7 @@ module.exports = {
},
},
{
files: ['**/__typechecks__/**', '*.md'],
files: ['**/__typetests__/**', '*.md'],
rules: {
'jest/no-focused-tests': 'off',
'jest/no-identical-title': 'off',
Expand Down Expand Up @@ -303,7 +303,7 @@ module.exports = {
devDependencies: [
'**/__mocks__/**',
'**/__tests__/**',
'**/__typechecks__/**',
'**/__typetests__/**',
'**/?(*.)(spec|test).js?(x)',
'scripts/**',
'babel.config.js',
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Expand Up @@ -36,7 +36,7 @@ module.exports = {
],
testPathIgnorePatterns: [
'/__arbitraries__/',
'/__typechecks__/',
'/__typetests__/',
'/node_modules/',
'/examples/',
'/e2e/.*/__tests__',
Expand Down
2 changes: 1 addition & 1 deletion jest.config.types.js → jest.config.tsd.js
Expand Up @@ -17,5 +17,5 @@ module.exports = {
modulePathIgnorePatterns,
roots: ['<rootDir>/packages'],
runner: 'jest-runner-tsd',
testMatch: ['**/__typechecks__/**/*.ts'],
testMatch: ['**/__typetests__/**/*.ts'],
};
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -14,6 +14,7 @@
"@jest/globals": "workspace:*",
"@jest/test-utils": "workspace:*",
"@tsconfig/node10": "^1.0.8",
"@tsd/typescript": "~4.1.5",
"@types/babel__core": "^7.0.0",
"@types/babel__generator": "^7.0.0",
"@types/babel__template": "^7.0.0",
Expand Down Expand Up @@ -55,7 +56,7 @@
"jest-changed-files": "workspace:*",
"jest-junit": "^13.0.0",
"jest-mock": "workspace:*",
"jest-runner-tsd": "^1.1.0",
"jest-runner-tsd": "^2.0.0",
"jest-silent-reporter": "^0.5.0",
"jest-snapshot": "workspace:*",
"jest-snapshot-serializer-raw": "^1.1.0",
Expand Down Expand Up @@ -102,7 +103,7 @@
"lint:prettier": "prettier '**/*.{md,yml,yaml}' 'website/**/*.{css,js}' --write --ignore-path .gitignore",
"lint:prettier:ci": "prettier '**/*.{md,yml,yaml}' 'website/**/*.{css,js}' --check --ignore-path .gitignore",
"remove-examples": "node ./scripts/remove-examples.js",
"test-types": "yarn jest --config jest.config.types.js",
"test-types": "yarn jest --config jest.config.tsd.js",
"test-ci": "yarn jest-coverage --color -i --config jest.config.ci.js && yarn test-leak && node ./scripts/mapCoverage.js && codecov",
"test-ci-partial": "yarn test-ci-partial:parallel -i",
"test-ci-partial:parallel": "yarn jest --color --config jest.config.ci.js",
Expand Down
2 changes: 2 additions & 0 deletions packages/babel-jest/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
// TODO: include `babel-preset-jest` if it's ever in TS even though we don't care about its types
"references": [
{"path": "../jest-transform"},
Expand Down
4 changes: 3 additions & 1 deletion packages/babel-plugin-jest-hoist/tsconfig.json
Expand Up @@ -3,5 +3,7 @@
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
}
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"]
}
4 changes: 3 additions & 1 deletion packages/diff-sequences/tsconfig.json
Expand Up @@ -3,5 +3,7 @@
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
}
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"]
}
2 changes: 1 addition & 1 deletion packages/expect/.npmignore
@@ -1,6 +1,6 @@
**/__mocks__/**
**/__tests__/**
__typechecks__
__typetests__
src
tsconfig.json
tsconfig.tsbuildinfo
9 changes: 9 additions & 0 deletions packages/expect/__typetests__/tsconfig.json
@@ -0,0 +1,9 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"noUnusedLocals": false,
"noUnusedParameters": false,
"skipLibCheck": true
},
"include": ["./**/*"]
}
2 changes: 2 additions & 0 deletions packages/expect/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../jest-get-type"},
{"path": "../jest-matcher-utils"},
Expand Down
1 change: 1 addition & 0 deletions packages/jest-changed-files/tsconfig.json
Expand Up @@ -4,5 +4,6 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"references": [{"path": "../jest-types"}]
}
2 changes: 2 additions & 0 deletions packages/jest-circus/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"outDir": "build",
"rootDir": "src"
},
"include": ["./src/**/*"],
"exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"],
"references": [
{"path": "../expect"},
{"path": "../jest-each"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-cli/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../jest-config"},
{"path": "../jest-core"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-config/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"],
// TODO: This is missing `babel-jest`, `jest-jasmine2`, `jest-circus` and
// jest-test-sequencer, but that is just `require.resolve`d, so no real use
// for their types
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-console/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../jest-message-util"},
{"path": "../jest-types"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-core/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../jest-changed-files"},
{"path": "../jest-config"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-create-cache-key-function/tsconfig.json
Expand Up @@ -4,5 +4,7 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [{"path": "../jest-types"}, {"path": "../jest-util"}]
}
2 changes: 2 additions & 0 deletions packages/jest-diff/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../diff-sequences"},
{"path": "../jest-get-type"},
Expand Down
4 changes: 3 additions & 1 deletion packages/jest-docblock/tsconfig.json
Expand Up @@ -3,5 +3,7 @@
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
}
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"]
}
2 changes: 2 additions & 0 deletions packages/jest-each/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../jest-get-type"},
{"path": "../jest-types"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-environment-jsdom/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"outDir": "build",
"rootDir": "src"
},
"include": ["./src/**/*"],
"exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"],
"references": [
{"path": "../jest-environment"},
{"path": "../jest-fake-timers"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-environment-node/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"outDir": "build",
"rootDir": "src"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../jest-environment"},
{"path": "../jest-fake-timers"},
Expand Down
1 change: 1 addition & 0 deletions packages/jest-environment/tsconfig.json
Expand Up @@ -6,6 +6,7 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"references": [
{"path": "../jest-fake-timers"},
{"path": "../jest-mock"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-fake-timers/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../jest-message-util"},
{"path": "../jest-mock"},
Expand Down
4 changes: 3 additions & 1 deletion packages/jest-get-type/tsconfig.json
Expand Up @@ -3,5 +3,7 @@
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
}
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"]
}
2 changes: 2 additions & 0 deletions packages/jest-globals/tsconfig.json
Expand Up @@ -6,6 +6,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../expect"},
{"path": "../jest-environment"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-haste-map/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../jest-regex-util"},
{"path": "../jest-serializer"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-jasmine2/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../expect"},
{"path": "../jest-each"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-leak-detector/tsconfig.json
Expand Up @@ -4,5 +4,7 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [{"path": "../jest-get-type"}, {"path": "../pretty-format"}]
}
2 changes: 2 additions & 0 deletions packages/jest-matcher-utils/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../jest-diff"},
{"path": "../jest-get-type"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-message-util/tsconfig.json
Expand Up @@ -4,5 +4,7 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [{"path": "../jest-types"}, {"path": "../pretty-format"}]
}
2 changes: 2 additions & 0 deletions packages/jest-mock/tsconfig.json
Expand Up @@ -4,5 +4,7 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [{"path": "../jest-types"}]
}
1 change: 1 addition & 0 deletions packages/jest-phabricator/tsconfig.json
Expand Up @@ -4,6 +4,7 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"references": [
{
"path": "../jest-test-result"
Expand Down
4 changes: 3 additions & 1 deletion packages/jest-regex-util/tsconfig.json
Expand Up @@ -3,5 +3,7 @@
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
}
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"]
}
2 changes: 2 additions & 0 deletions packages/jest-repl/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../jest-config"},
{"path": "../jest-console"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-reporters/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../jest-console"},
{"path": "../jest-haste-map"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-resolve-dependencies/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../jest-haste-map"},
{"path": "../jest-regex-util"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-resolve/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"],
"references": [
{"path": "../jest-haste-map"},
{"path": "../jest-types"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-runner/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../jest-console"},
{"path": "../jest-docblock"},
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-runtime/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"],
"references": [
{"path": "../jest-environment"},
{"path": "../jest-environment-node"},
Expand Down
4 changes: 3 additions & 1 deletion packages/jest-serializer/tsconfig.json
Expand Up @@ -3,5 +3,7 @@
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
}
},
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"]
}
2 changes: 2 additions & 0 deletions packages/jest-snapshot/tsconfig.json
Expand Up @@ -4,6 +4,8 @@
"rootDir": "src",
"outDir": "build"
},
"include": ["./src/**/*"],
"exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"],
"references": [
{"path": "../expect"},
{"path": "../jest-diff"},
Expand Down

0 comments on commit 8a62d98

Please sign in to comment.