From e88b37619ceb00c171027bb0b9f9b4f7af75a8ca Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Fri, 30 Sep 2022 11:21:35 +0300 Subject: [PATCH 01/12] chore: replace `@types/jest` with `@jest/test-globals` --- package.json | 1 + packages/test-globals/README.md | 3 ++ packages/test-globals/package.json | 21 ++++++++++ packages/test-globals/src/index.ts | 64 +++++++++++++++++++++++++++++ packages/test-globals/tsconfig.json | 11 +++++ scripts/bundleTs.mjs | 2 +- yarn.lock | 10 +++++ 7 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 packages/test-globals/README.md create mode 100644 packages/test-globals/package.json create mode 100644 packages/test-globals/src/index.ts create mode 100644 packages/test-globals/tsconfig.json diff --git a/package.json b/package.json index 4f0964d13fbd..75343a5a0fbb 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "@babel/register": "^7.0.0", "@crowdin/cli": "^3.5.2", "@jest/globals": "workspace:^", + "@jest/test-globals": "workspace:^", "@jest/test-utils": "workspace:^", "@lerna-lite/cli": "^1.11.3", "@microsoft/api-extractor": "^7.29.0", diff --git a/packages/test-globals/README.md b/packages/test-globals/README.md new file mode 100644 index 000000000000..4de287a67c19 --- /dev/null +++ b/packages/test-globals/README.md @@ -0,0 +1,3 @@ +# test-globals + +Private package which provides type declarations of Jest's global test APIs for tests of Jest repo. diff --git a/packages/test-globals/package.json b/packages/test-globals/package.json new file mode 100644 index 000000000000..0d8b1d7aa591 --- /dev/null +++ b/packages/test-globals/package.json @@ -0,0 +1,21 @@ +{ + "name": "@jest/test-globals", + "version": "29.1.0", + "private": true, + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "@jest/globals": "workspace:^", + "jest-mock": "workspace:^" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } +} diff --git a/packages/test-globals/src/index.ts b/packages/test-globals/src/index.ts new file mode 100644 index 000000000000..19f3dd0fbc3c --- /dev/null +++ b/packages/test-globals/src/index.ts @@ -0,0 +1,64 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import type { + ClassLike, + FunctionLike, + Mock as JestMock, + Mocked as JestMocked, + MockedClass as JestMockedClass, + MockedFunction as JestMockedFunction, + MockedObject as JestMockedObject, + UnknownFunction, +} from 'jest-mock'; + +declare global { + const beforeAll: typeof import('@jest/globals')['beforeAll']; + const beforeEach: typeof import('@jest/globals')['beforeEach']; + + const afterEach: typeof import('@jest/globals')['afterEach']; + const afterAll: typeof import('@jest/globals')['afterAll']; + + const describe: typeof import('@jest/globals')['describe']; + const fdescribe: typeof import('@jest/globals')['fdescribe']; + const xdescribe: typeof import('@jest/globals')['xdescribe']; + + const it: typeof import('@jest/globals')['it']; + const fit: typeof import('@jest/globals')['fit']; + const xit: typeof import('@jest/globals')['xit']; + + const test: typeof import('@jest/globals')['test']; + const xtest: typeof import('@jest/globals')['xtest']; + + const expect: typeof import('@jest/globals')['expect']; + + const jest: typeof import('@jest/globals')['jest']; + + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace jest { + /** + * Constructs the type of a mock function, e.g. the return type of `jest.fn()`. + */ + export type Mock = JestMock; + /** + * Wraps a class, function or object type with Jest mock type definitions. + */ + export type Mocked = JestMocked; + /** + * Wraps a class type with Jest mock type definitions. + */ + export type MockedClass = JestMockedClass; + /** + * Wraps a function type with Jest mock type definitions. + */ + export type MockedFunction = JestMockedFunction; + /** + * Wraps an object type with Jest mock type definitions. + */ + export type MockedObject = JestMockedObject; + } +} diff --git a/packages/test-globals/tsconfig.json b/packages/test-globals/tsconfig.json new file mode 100644 index 000000000000..5dd6af7aafa6 --- /dev/null +++ b/packages/test-globals/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "build", + // we don't want `@types/jest` to be referenced + "types": [] + }, + "include": ["./src/**/*"], + "references": [{"path": "../jest-globals"}, {"path": "../jest-mock"}] +} diff --git a/scripts/bundleTs.mjs b/scripts/bundleTs.mjs index f4a7805cd467..75b7f1e3f683 100644 --- a/scripts/bundleTs.mjs +++ b/scripts/bundleTs.mjs @@ -38,7 +38,7 @@ const copyrightSnippet = ` const typesNodeReferenceDirective = '/// '; -const excludedPackages = new Set(['@jest/globals']); +const excludedPackages = new Set(['@jest/globals', '@jest/test-globals']); (async () => { const packages = getPackages(); diff --git a/yarn.lock b/yarn.lock index 9014bf3f6507..250c8c566241 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2750,6 +2750,7 @@ __metadata: "@babel/register": ^7.0.0 "@crowdin/cli": ^3.5.2 "@jest/globals": "workspace:^" + "@jest/test-globals": "workspace:^" "@jest/test-utils": "workspace:^" "@lerna-lite/cli": ^1.11.3 "@microsoft/api-extractor": ^7.29.0 @@ -2905,6 +2906,15 @@ __metadata: languageName: unknown linkType: soft +"@jest/test-globals@workspace:^, @jest/test-globals@workspace:packages/test-globals": + version: 0.0.0-use.local + resolution: "@jest/test-globals@workspace:packages/test-globals" + dependencies: + "@jest/globals": "workspace:^" + jest-mock: "workspace:^" + languageName: unknown + linkType: soft + "@jest/test-result@npm:^28.1.3": version: 28.1.3 resolution: "@jest/test-result@npm:28.1.3" From fa584cac0211c846e0f78b49f475b394dda5f383 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Fri, 30 Sep 2022 13:53:16 +0300 Subject: [PATCH 02/12] use types form `@jest/test-globals` --- e2e/tsconfig.json | 24 ++++--------------- package.json | 1 - .../babel-jest/src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/isError.test.ts | 2 ++ .../expect-utils/src/__tests__/tsconfig.json | 9 +++++++ .../expect/src/__tests__/toEqual-dom.test.ts | 3 +++ packages/expect/src/__tests__/tsconfig.json | 9 +++++++ .../jest-circus/src/__tests__/tsconfig.json | 9 +++++++ packages/jest-cli/src/__tests__/tsconfig.json | 9 +++++++ .../jest-cli/src/init/__tests__/tsconfig.json | 9 +++++++ .../jest-config/src/__tests__/tsconfig.json | 9 +++++++ .../jest-console/src/__tests__/tsconfig.json | 9 +++++++ .../jest-core/src/__tests__/tsconfig.json | 9 +++++++ .../jest-core/src/lib/__tests__/tsconfig.json | 9 +++++++ .../src/plugins/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../jest-diff/src/__tests__/tsconfig.json | 9 +++++++ .../jest-docblock/src/__tests__/tsconfig.json | 9 +++++++ .../jest-each/src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/legacyFakeTimers.test.ts | 2 ++ .../src/__tests__/tsconfig.json | 9 +++++++ .../jest-get-type/src/__tests__/tsconfig.json | 9 +++++++ .../jest-globals/src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../src/crawlers/__tests__/tsconfig.json | 9 +++++++ .../src/lib/__tests__/tsconfig.json | 9 +++++++ .../jest-jasmine2/src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../deepCyclicCopyReplaceableDom.test.ts | 4 ++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../jest-mock/src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../jest-repl/src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../jest-resolve/src/__tests__/tsconfig.json | 9 +++++++ .../jest-runner/src/__tests__/tsconfig.json | 9 +++++++ .../jest-runtime/src/__tests__/tsconfig.json | 9 +++++++ .../jest-snapshot/src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/tsconfig.json | 9 +++++++ .../jest-util/src/__tests__/tsconfig.json | 9 +++++++ .../jest-validate/src/__tests__/tsconfig.json | 9 +++++++ .../src/lib/__tests__/tsconfig.json | 9 +++++++ .../jest-worker/src/__tests__/tsconfig.json | 9 +++++++ .../src/base/__tests__/tsconfig.json | 9 +++++++ .../src/workers/__tests__/tsconfig.json | 9 +++++++ .../src/__tests__/DOMElement.test.ts | 3 +++ .../src/__tests__/setPrettyPrint.ts | 9 +++---- .../pretty-format/src/__tests__/tsconfig.json | 9 +++++++ yarn.lock | 1 - 58 files changed, 463 insertions(+), 27 deletions(-) create mode 100644 packages/babel-jest/src/__tests__/tsconfig.json create mode 100644 packages/babel-plugin-jest-hoist/src/__tests__/tsconfig.json create mode 100644 packages/diff-sequences/src/__tests__/tsconfig.json create mode 100644 packages/expect-utils/src/__tests__/tsconfig.json create mode 100644 packages/expect/src/__tests__/tsconfig.json create mode 100644 packages/jest-circus/src/__tests__/tsconfig.json create mode 100644 packages/jest-cli/src/__tests__/tsconfig.json create mode 100644 packages/jest-cli/src/init/__tests__/tsconfig.json create mode 100644 packages/jest-config/src/__tests__/tsconfig.json create mode 100644 packages/jest-console/src/__tests__/tsconfig.json create mode 100644 packages/jest-core/src/__tests__/tsconfig.json create mode 100644 packages/jest-core/src/lib/__tests__/tsconfig.json create mode 100644 packages/jest-core/src/plugins/__tests__/tsconfig.json create mode 100644 packages/jest-create-cache-key-function/src/__tests__/tsconfig.json create mode 100644 packages/jest-diff/src/__tests__/tsconfig.json create mode 100644 packages/jest-docblock/src/__tests__/tsconfig.json create mode 100644 packages/jest-each/src/__tests__/tsconfig.json create mode 100644 packages/jest-environment-jsdom/src/__tests__/tsconfig.json create mode 100644 packages/jest-environment-node/src/__tests__/tsconfig.json create mode 100644 packages/jest-fake-timers/src/__tests__/tsconfig.json create mode 100644 packages/jest-get-type/src/__tests__/tsconfig.json create mode 100644 packages/jest-globals/src/__tests__/tsconfig.json create mode 100644 packages/jest-haste-map/src/__tests__/tsconfig.json create mode 100644 packages/jest-haste-map/src/crawlers/__tests__/tsconfig.json create mode 100644 packages/jest-haste-map/src/lib/__tests__/tsconfig.json create mode 100644 packages/jest-jasmine2/src/__tests__/tsconfig.json create mode 100644 packages/jest-leak-detector/src/__tests__/tsconfig.json create mode 100644 packages/jest-matcher-utils/src/__tests__/tsconfig.json create mode 100644 packages/jest-message-util/src/__tests__/tsconfig.json create mode 100644 packages/jest-mock/src/__tests__/tsconfig.json create mode 100644 packages/jest-regex-util/src/__tests__/tsconfig.json create mode 100644 packages/jest-repl/src/__tests__/tsconfig.json create mode 100644 packages/jest-reporters/src/__tests__/tsconfig.json create mode 100644 packages/jest-resolve-dependencies/src/__tests__/tsconfig.json create mode 100644 packages/jest-resolve/src/__tests__/tsconfig.json create mode 100644 packages/jest-runner/src/__tests__/tsconfig.json create mode 100644 packages/jest-runtime/src/__tests__/tsconfig.json create mode 100644 packages/jest-snapshot/src/__tests__/tsconfig.json create mode 100644 packages/jest-source-map/src/__tests__/tsconfig.json create mode 100644 packages/jest-test-result/src/__tests__/tsconfig.json create mode 100644 packages/jest-test-sequencer/src/__tests__/tsconfig.json create mode 100644 packages/jest-transform/src/__tests__/tsconfig.json create mode 100644 packages/jest-util/src/__tests__/tsconfig.json create mode 100644 packages/jest-validate/src/__tests__/tsconfig.json create mode 100644 packages/jest-watcher/src/lib/__tests__/tsconfig.json create mode 100644 packages/jest-worker/src/__tests__/tsconfig.json create mode 100644 packages/jest-worker/src/base/__tests__/tsconfig.json create mode 100644 packages/jest-worker/src/workers/__tests__/tsconfig.json create mode 100644 packages/pretty-format/src/__tests__/tsconfig.json diff --git a/e2e/tsconfig.json b/e2e/tsconfig.json index a25747da2a2d..bc234a9fa790 100644 --- a/e2e/tsconfig.json +++ b/e2e/tsconfig.json @@ -1,22 +1,8 @@ { + "extends": "../tsconfig.json", "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/test-globals"] + }, + "include": ["../**/*"] } diff --git a/package.json b/package.json index 75343a5a0fbb..d2fb022ad239 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "@types/babel__generator": "^7.0.0", "@types/babel__template": "^7.0.2", "@types/dedent": "^0.7.0", - "@types/jest": "^27.4.0", "@types/node": "~14.14.45", "@types/which": "^2.0.0", "@typescript-eslint/eslint-plugin": "^5.14.0", diff --git a/packages/babel-jest/src/__tests__/tsconfig.json b/packages/babel-jest/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/babel-jest/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/babel-plugin-jest-hoist/src/__tests__/tsconfig.json b/packages/babel-plugin-jest-hoist/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/babel-plugin-jest-hoist/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/diff-sequences/src/__tests__/tsconfig.json b/packages/diff-sequences/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/diff-sequences/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/expect-utils/src/__tests__/isError.test.ts b/packages/expect-utils/src/__tests__/isError.test.ts index bb6a77c47e6d..8a25e970f153 100644 --- a/packages/expect-utils/src/__tests__/isError.test.ts +++ b/packages/expect-utils/src/__tests__/isError.test.ts @@ -7,6 +7,8 @@ * @jest-environment jsdom */ +/// + /* eslint-env browser */ import {isError} from '../utils'; diff --git a/packages/expect-utils/src/__tests__/tsconfig.json b/packages/expect-utils/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/expect-utils/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/expect/src/__tests__/toEqual-dom.test.ts b/packages/expect/src/__tests__/toEqual-dom.test.ts index 605c7e628537..864536dc39ca 100644 --- a/packages/expect/src/__tests__/toEqual-dom.test.ts +++ b/packages/expect/src/__tests__/toEqual-dom.test.ts @@ -6,6 +6,9 @@ * * @jest-environment jsdom */ + +/// + /* eslint-env browser*/ describe('toEqual', () => { diff --git a/packages/expect/src/__tests__/tsconfig.json b/packages/expect/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/expect/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-circus/src/__tests__/tsconfig.json b/packages/jest-circus/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-circus/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-cli/src/__tests__/tsconfig.json b/packages/jest-cli/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-cli/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-cli/src/init/__tests__/tsconfig.json b/packages/jest-cli/src/init/__tests__/tsconfig.json new file mode 100644 index 000000000000..13aa0afc4960 --- /dev/null +++ b/packages/jest-cli/src/init/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-config/src/__tests__/tsconfig.json b/packages/jest-config/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-config/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-console/src/__tests__/tsconfig.json b/packages/jest-console/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-console/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-core/src/__tests__/tsconfig.json b/packages/jest-core/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-core/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-core/src/lib/__tests__/tsconfig.json b/packages/jest-core/src/lib/__tests__/tsconfig.json new file mode 100644 index 000000000000..13aa0afc4960 --- /dev/null +++ b/packages/jest-core/src/lib/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-core/src/plugins/__tests__/tsconfig.json b/packages/jest-core/src/plugins/__tests__/tsconfig.json new file mode 100644 index 000000000000..13aa0afc4960 --- /dev/null +++ b/packages/jest-core/src/plugins/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-create-cache-key-function/src/__tests__/tsconfig.json b/packages/jest-create-cache-key-function/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-create-cache-key-function/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-diff/src/__tests__/tsconfig.json b/packages/jest-diff/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-diff/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-docblock/src/__tests__/tsconfig.json b/packages/jest-docblock/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-docblock/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-each/src/__tests__/tsconfig.json b/packages/jest-each/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-each/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-environment-jsdom/src/__tests__/tsconfig.json b/packages/jest-environment-jsdom/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-environment-jsdom/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-environment-node/src/__tests__/tsconfig.json b/packages/jest-environment-node/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-environment-node/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-fake-timers/src/__tests__/legacyFakeTimers.test.ts b/packages/jest-fake-timers/src/__tests__/legacyFakeTimers.test.ts index b7ccac600f93..f9480b63dff2 100644 --- a/packages/jest-fake-timers/src/__tests__/legacyFakeTimers.test.ts +++ b/packages/jest-fake-timers/src/__tests__/legacyFakeTimers.test.ts @@ -5,6 +5,8 @@ * LICENSE file in the root directory of this source tree. */ +/// + import * as util from 'util'; import {runInNewContext} from 'vm'; import {ModuleMocker} from 'jest-mock'; diff --git a/packages/jest-fake-timers/src/__tests__/tsconfig.json b/packages/jest-fake-timers/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-fake-timers/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-get-type/src/__tests__/tsconfig.json b/packages/jest-get-type/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-get-type/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-globals/src/__tests__/tsconfig.json b/packages/jest-globals/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-globals/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-haste-map/src/__tests__/tsconfig.json b/packages/jest-haste-map/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-haste-map/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-haste-map/src/crawlers/__tests__/tsconfig.json b/packages/jest-haste-map/src/crawlers/__tests__/tsconfig.json new file mode 100644 index 000000000000..13aa0afc4960 --- /dev/null +++ b/packages/jest-haste-map/src/crawlers/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-haste-map/src/lib/__tests__/tsconfig.json b/packages/jest-haste-map/src/lib/__tests__/tsconfig.json new file mode 100644 index 000000000000..13aa0afc4960 --- /dev/null +++ b/packages/jest-haste-map/src/lib/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-jasmine2/src/__tests__/tsconfig.json b/packages/jest-jasmine2/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-jasmine2/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-leak-detector/src/__tests__/tsconfig.json b/packages/jest-leak-detector/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-leak-detector/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-matcher-utils/src/__tests__/deepCyclicCopyReplaceableDom.test.ts b/packages/jest-matcher-utils/src/__tests__/deepCyclicCopyReplaceableDom.test.ts index 31536d9c4372..80c68367e27b 100644 --- a/packages/jest-matcher-utils/src/__tests__/deepCyclicCopyReplaceableDom.test.ts +++ b/packages/jest-matcher-utils/src/__tests__/deepCyclicCopyReplaceableDom.test.ts @@ -6,7 +6,11 @@ * * @jest-environment jsdom */ + +/// + /* eslint-env browser*/ + import deepCyclicCopyReplaceable from '../deepCyclicCopyReplaceable'; test('should copy dom element', () => { diff --git a/packages/jest-matcher-utils/src/__tests__/tsconfig.json b/packages/jest-matcher-utils/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-matcher-utils/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-message-util/src/__tests__/tsconfig.json b/packages/jest-message-util/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-message-util/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-mock/src/__tests__/tsconfig.json b/packages/jest-mock/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..2ac9dcb9f603 --- /dev/null +++ b/packages/jest-mock/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals", "node"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-regex-util/src/__tests__/tsconfig.json b/packages/jest-regex-util/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-regex-util/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-repl/src/__tests__/tsconfig.json b/packages/jest-repl/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-repl/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-reporters/src/__tests__/tsconfig.json b/packages/jest-reporters/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-reporters/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-resolve-dependencies/src/__tests__/tsconfig.json b/packages/jest-resolve-dependencies/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-resolve-dependencies/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-resolve/src/__tests__/tsconfig.json b/packages/jest-resolve/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-resolve/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-runner/src/__tests__/tsconfig.json b/packages/jest-runner/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-runner/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-runtime/src/__tests__/tsconfig.json b/packages/jest-runtime/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-runtime/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-snapshot/src/__tests__/tsconfig.json b/packages/jest-snapshot/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-snapshot/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-source-map/src/__tests__/tsconfig.json b/packages/jest-source-map/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-source-map/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-test-result/src/__tests__/tsconfig.json b/packages/jest-test-result/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-test-result/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-test-sequencer/src/__tests__/tsconfig.json b/packages/jest-test-sequencer/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-test-sequencer/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-transform/src/__tests__/tsconfig.json b/packages/jest-transform/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-transform/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-util/src/__tests__/tsconfig.json b/packages/jest-util/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-util/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-validate/src/__tests__/tsconfig.json b/packages/jest-validate/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-validate/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-watcher/src/lib/__tests__/tsconfig.json b/packages/jest-watcher/src/lib/__tests__/tsconfig.json new file mode 100644 index 000000000000..105289d8abbd --- /dev/null +++ b/packages/jest-watcher/src/lib/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-worker/src/__tests__/tsconfig.json b/packages/jest-worker/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/jest-worker/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-worker/src/base/__tests__/tsconfig.json b/packages/jest-worker/src/base/__tests__/tsconfig.json new file mode 100644 index 000000000000..13aa0afc4960 --- /dev/null +++ b/packages/jest-worker/src/base/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/jest-worker/src/workers/__tests__/tsconfig.json b/packages/jest-worker/src/workers/__tests__/tsconfig.json new file mode 100644 index 000000000000..13aa0afc4960 --- /dev/null +++ b/packages/jest-worker/src/workers/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/packages/pretty-format/src/__tests__/DOMElement.test.ts b/packages/pretty-format/src/__tests__/DOMElement.test.ts index 6a39f2576512..c8e14e83dfa5 100644 --- a/packages/pretty-format/src/__tests__/DOMElement.test.ts +++ b/packages/pretty-format/src/__tests__/DOMElement.test.ts @@ -6,6 +6,9 @@ * * @jest-environment jsdom */ + +/// + /* eslint-env browser*/ import prettyFormat, {plugins} from '../'; diff --git a/packages/pretty-format/src/__tests__/setPrettyPrint.ts b/packages/pretty-format/src/__tests__/setPrettyPrint.ts index 5317d89f9cce..e82ce4f9b87e 100644 --- a/packages/pretty-format/src/__tests__/setPrettyPrint.ts +++ b/packages/pretty-format/src/__tests__/setPrettyPrint.ts @@ -8,12 +8,9 @@ import prettyFormat from '../'; import type {OptionsReceived, Plugins} from '../types'; -declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace - namespace jest { - interface Matchers { - toPrettyPrintTo(expected: unknown, options?: OptionsReceived): R; - } +declare module 'expect' { + interface Matchers { + toPrettyPrintTo(expected: unknown, options?: OptionsReceived): R; } } diff --git a/packages/pretty-format/src/__tests__/tsconfig.json b/packages/pretty-format/src/__tests__/tsconfig.json new file mode 100644 index 000000000000..75f0b8c12a33 --- /dev/null +++ b/packages/pretty-format/src/__tests__/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "composite": false, + "rootDir": "../", + "types": ["@jest/test-globals"] + }, + "include": ["../**/*"] +} diff --git a/yarn.lock b/yarn.lock index 81ef1e80cd33..b7d4cb3af9a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2760,7 +2760,6 @@ __metadata: "@types/babel__generator": ^7.0.0 "@types/babel__template": ^7.0.2 "@types/dedent": ^0.7.0 - "@types/jest": ^27.4.0 "@types/node": ~14.14.45 "@types/which": ^2.0.0 "@typescript-eslint/eslint-plugin": ^5.14.0 From eb97554aaf3ea55a7241d037ce2da44d1596fd7d Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Fri, 30 Sep 2022 16:02:39 +0300 Subject: [PATCH 03/12] use `@jest/globals` in examples --- examples/angular/package.json | 2 +- .../__tests__/CheckboxWithLabel-test.tsx | 1 + examples/typescript/__tests__/calc.test.ts | 2 +- examples/typescript/__tests__/sub-test.ts | 1 + examples/typescript/__tests__/sum-test.ts | 2 + examples/typescript/__tests__/sum.test.js | 2 + examples/typescript/package.json | 2 +- yarn.lock | 54 ++----------------- 8 files changed, 12 insertions(+), 54 deletions(-) diff --git a/examples/angular/package.json b/examples/angular/package.json index 96b8b27260f7..cb64e7476e6d 100644 --- a/examples/angular/package.json +++ b/examples/angular/package.json @@ -23,7 +23,7 @@ "@babel/plugin-proposal-decorators": "*", "@babel/preset-env": "^7.1.0", "@babel/preset-typescript": "^7.0.0", - "@types/jest": "^27.4.0", + "@jest/globals": "workspace:^", "babel-jest": "workspace:^", "babel-plugin-transform-typescript-metadata": "*", "jest": "workspace:^", diff --git a/examples/typescript/__tests__/CheckboxWithLabel-test.tsx b/examples/typescript/__tests__/CheckboxWithLabel-test.tsx index 85159d2d4b15..eee9891e53a9 100644 --- a/examples/typescript/__tests__/CheckboxWithLabel-test.tsx +++ b/examples/typescript/__tests__/CheckboxWithLabel-test.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import * as TestUtils from 'react-dom/test-utils'; +import {expect, it} from '@jest/globals'; const CheckboxWithLabel = require('../CheckboxWithLabel').default; diff --git a/examples/typescript/__tests__/calc.test.ts b/examples/typescript/__tests__/calc.test.ts index 7a05eadd8757..6a66a4de000d 100644 --- a/examples/typescript/__tests__/calc.test.ts +++ b/examples/typescript/__tests__/calc.test.ts @@ -1,6 +1,6 @@ // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. -import {jest} from '@jest/globals'; +import {describe, expect, it, jest} from '@jest/globals'; import Memory from '../memory'; import sub from '../sub'; diff --git a/examples/typescript/__tests__/sub-test.ts b/examples/typescript/__tests__/sub-test.ts index 98633bcd3ea3..e3330c8b8c95 100644 --- a/examples/typescript/__tests__/sub-test.ts +++ b/examples/typescript/__tests__/sub-test.ts @@ -1,6 +1,7 @@ // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. import sub from '../sub'; +import {expect, it} from '@jest/globals'; it('subtracts 5 - 1 to equal 4 in TypeScript', () => { expect(sub(5, 1)).toBe(4); diff --git a/examples/typescript/__tests__/sum-test.ts b/examples/typescript/__tests__/sum-test.ts index 2eb4f77dd7c5..a401c5d46ac0 100644 --- a/examples/typescript/__tests__/sum-test.ts +++ b/examples/typescript/__tests__/sum-test.ts @@ -1,5 +1,7 @@ // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +import {expect, it} from '@jest/globals'; + it('adds 1 + 2 to equal 3 in TScript', () => { // Generally, `import` should be used for TypeScript // as using `require` will not return any type information. diff --git a/examples/typescript/__tests__/sum.test.js b/examples/typescript/__tests__/sum.test.js index 613234f54d3e..3bcb0749a939 100644 --- a/examples/typescript/__tests__/sum.test.js +++ b/examples/typescript/__tests__/sum.test.js @@ -1,5 +1,7 @@ // Copyright 2004-present Facebook. All Rights Reserved. +import {expect, it} from '@jest/globals'; + it('adds 1 + 2 to equal 3 in Typescript', () => { const sum = require('../sum.ts').default; expect(sum(1, 2)).toBe(3); diff --git a/examples/typescript/package.json b/examples/typescript/package.json index ba82fc707a0d..3ca4c4463cf5 100644 --- a/examples/typescript/package.json +++ b/examples/typescript/package.json @@ -12,7 +12,7 @@ "@babel/preset-env": "^7.1.0", "@babel/preset-react": "^7.12.1", "@babel/preset-typescript": "^7.0.0", - "@types/jest": "^27.4.0", + "@jest/globals": "workspace:^", "babel-jest": "workspace:^", "jest": "workspace:^" }, diff --git a/yarn.lock b/yarn.lock index b7d4cb3af9a4..11ff523d2e35 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4621,16 +4621,6 @@ __metadata: languageName: node linkType: hard -"@types/jest@npm:^27.4.0": - version: 27.5.2 - resolution: "@types/jest@npm:27.5.2" - dependencies: - jest-matcher-utils: ^27.0.0 - pretty-format: ^27.0.0 - checksum: 7e11c6826aa429ad990dc262e4e4b54aa36573287fddf15773e4137f07d11d3105f0dd9f1baff73252160a057df23f5529bb83b1bf83cd3f45f9460a5ca5c22e - languageName: node - linkType: hard - "@types/jsdom@npm:^20.0.0": version: 20.0.0 resolution: "@types/jsdom@npm:20.0.0" @@ -5670,7 +5660,7 @@ __metadata: "@babel/plugin-proposal-decorators": "*" "@babel/preset-env": ^7.1.0 "@babel/preset-typescript": ^7.0.0 - "@types/jest": ^27.4.0 + "@jest/globals": "workspace:^" babel-jest: "workspace:^" babel-plugin-transform-typescript-metadata: "*" core-js: ^3.2.1 @@ -8356,13 +8346,6 @@ __metadata: languageName: node linkType: hard -"diff-sequences@npm:^27.5.1": - version: 27.5.1 - resolution: "diff-sequences@npm:27.5.1" - checksum: a00db5554c9da7da225db2d2638d85f8e41124eccbd56cbaefb3b276dcbb1c1c2ad851c32defe2055a54a4806f030656cbf6638105fd6ce97bb87b90b32a33ca - languageName: node - linkType: hard - "diff-sequences@workspace:^, diff-sequences@workspace:packages/diff-sequences": version: 0.0.0-use.local resolution: "diff-sequences@workspace:packages/diff-sequences" @@ -9572,7 +9555,7 @@ __metadata: "@babel/preset-env": ^7.1.0 "@babel/preset-react": ^7.12.1 "@babel/preset-typescript": ^7.0.0 - "@types/jest": ^27.4.0 + "@jest/globals": "workspace:^" babel-jest: "workspace:^" jest: "workspace:^" react: 17.0.2 @@ -12387,18 +12370,6 @@ __metadata: languageName: unknown linkType: soft -"jest-diff@npm:^27.5.1": - version: 27.5.1 - resolution: "jest-diff@npm:27.5.1" - dependencies: - chalk: ^4.0.0 - diff-sequences: ^27.5.1 - jest-get-type: ^27.5.1 - pretty-format: ^27.5.1 - checksum: 8be27c1e1ee57b2bb2bef9c0b233c19621b4c43d53a3c26e2c00a4e805eb4ea11fe1694a06a9fb0e80ffdcfdc0d2b1cb0b85920b3f5c892327ecd1e7bd96b865 - languageName: node - linkType: hard - "jest-diff@workspace:^, jest-diff@workspace:packages/jest-diff": version: 0.0.0-use.local resolution: "jest-diff@workspace:packages/jest-diff" @@ -12470,13 +12441,6 @@ __metadata: languageName: node linkType: hard -"jest-get-type@npm:^27.5.1": - version: 27.5.1 - resolution: "jest-get-type@npm:27.5.1" - checksum: 63064ab70195c21007d897c1157bf88ff94a790824a10f8c890392e7d17eda9c3900513cb291ca1c8d5722cad79169764e9a1279f7c8a9c4cd6e9109ff04bbc0 - languageName: node - linkType: hard - "jest-get-type@workspace:^, jest-get-type@workspace:packages/jest-get-type": version: 0.0.0-use.local resolution: "jest-get-type@workspace:packages/jest-get-type" @@ -12555,18 +12519,6 @@ __metadata: languageName: unknown linkType: soft -"jest-matcher-utils@npm:^27.0.0": - version: 27.5.1 - resolution: "jest-matcher-utils@npm:27.5.1" - dependencies: - chalk: ^4.0.0 - jest-diff: ^27.5.1 - jest-get-type: ^27.5.1 - pretty-format: ^27.5.1 - checksum: bb2135fc48889ff3fe73888f6cc7168ddab9de28b51b3148f820c89fdfd2effdcad005f18be67d0b9be80eda208ad47290f62f03d0a33f848db2dd0273c8217a - languageName: node - linkType: hard - "jest-matcher-utils@workspace:^, jest-matcher-utils@workspace:packages/jest-matcher-utils": version: 0.0.0-use.local resolution: "jest-matcher-utils@workspace:packages/jest-matcher-utils" @@ -16895,7 +16847,7 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:^27.0.0, pretty-format@npm:^27.0.2, pretty-format@npm:^27.5.1": +"pretty-format@npm:^27.0.2": version: 27.5.1 resolution: "pretty-format@npm:27.5.1" dependencies: From 377d18df20900a7214175596f6d7e9b44c0bf175 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Fri, 30 Sep 2022 16:03:43 +0300 Subject: [PATCH 04/12] clean up --- packages/jest-circus/tsconfig.json | 4 +--- packages/jest-environment/tsconfig.json | 2 -- packages/jest-globals/tsconfig.json | 2 -- packages/jest-jasmine2/tsconfig.json | 4 +--- packages/test-globals/tsconfig.json | 4 +--- packages/test-utils/tsconfig.json | 4 +--- 6 files changed, 4 insertions(+), 16 deletions(-) diff --git a/packages/jest-circus/tsconfig.json b/packages/jest-circus/tsconfig.json index 67941a37790e..5722ca1d21ac 100644 --- a/packages/jest-circus/tsconfig.json +++ b/packages/jest-circus/tsconfig.json @@ -2,9 +2,7 @@ "extends": "../../tsconfig", "compilerOptions": { "outDir": "build", - "rootDir": "src", - // we don't want `@types/jest` to be referenced - "types": [] + "rootDir": "src" }, "include": ["./src/**/*"], "exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"], diff --git a/packages/jest-environment/tsconfig.json b/packages/jest-environment/tsconfig.json index 3b0f77d1c9c5..4ac228a90ddf 100644 --- a/packages/jest-environment/tsconfig.json +++ b/packages/jest-environment/tsconfig.json @@ -1,8 +1,6 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - // we don't want `@types/jest` to be referenced - "types": ["node"], "rootDir": "src", "outDir": "build" }, diff --git a/packages/jest-globals/tsconfig.json b/packages/jest-globals/tsconfig.json index 90f222531f6b..06c39bed1061 100644 --- a/packages/jest-globals/tsconfig.json +++ b/packages/jest-globals/tsconfig.json @@ -1,8 +1,6 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - // we don't want `@types/jest` to be referenced - "types": [], "rootDir": "src", "outDir": "build" }, diff --git a/packages/jest-jasmine2/tsconfig.json b/packages/jest-jasmine2/tsconfig.json index 3d2268f04774..ecd8d01247bf 100644 --- a/packages/jest-jasmine2/tsconfig.json +++ b/packages/jest-jasmine2/tsconfig.json @@ -2,9 +2,7 @@ "extends": "../../tsconfig", "compilerOptions": { "rootDir": "src", - "outDir": "build", - // we don't want `@types/jest` to be referenced - "types": [] + "outDir": "build" }, "include": ["./src/**/*"], "exclude": ["./**/__tests__/**/*"], diff --git a/packages/test-globals/tsconfig.json b/packages/test-globals/tsconfig.json index 5dd6af7aafa6..88ebc1efb2e0 100644 --- a/packages/test-globals/tsconfig.json +++ b/packages/test-globals/tsconfig.json @@ -2,9 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "rootDir": "src", - "outDir": "build", - // we don't want `@types/jest` to be referenced - "types": [] + "outDir": "build" }, "include": ["./src/**/*"], "references": [{"path": "../jest-globals"}, {"path": "../jest-mock"}] diff --git a/packages/test-utils/tsconfig.json b/packages/test-utils/tsconfig.json index 081c80a123be..110097eb7fef 100644 --- a/packages/test-utils/tsconfig.json +++ b/packages/test-utils/tsconfig.json @@ -2,9 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "rootDir": "src", - "outDir": "build", - // we don't want `@types/jest` to be referenced - "types": ["node"] + "outDir": "build" }, "include": ["./src/**/*"], "references": [{"path": "../jest-types"}, {"path": "../pretty-format"}] From 3aaa602c1846019e030a1f3a636202692ae14425 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Fri, 30 Sep 2022 20:49:47 +0300 Subject: [PATCH 05/12] fix lock --- yarn.lock | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/yarn.lock b/yarn.lock index c5dfdbf66dc4..11ff523d2e35 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,3 +1,6 @@ +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + __metadata: version: 6 cacheKey: 8 @@ -5657,6 +5660,7 @@ __metadata: "@babel/plugin-proposal-decorators": "*" "@babel/preset-env": ^7.1.0 "@babel/preset-typescript": ^7.0.0 + "@jest/globals": "workspace:^" babel-jest: "workspace:^" babel-plugin-transform-typescript-metadata: "*" core-js: ^3.2.1 From 04b951de9cef0a81f0ed3142e0ca1505a509a4a4 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Fri, 30 Sep 2022 21:04:55 +0300 Subject: [PATCH 06/12] rework imports --- packages/test-globals/package.json | 4 +++- packages/test-globals/src/index.ts | 31 ++++++++++++++++------------- packages/test-globals/tsconfig.json | 7 ++++++- yarn.lock | 4 +++- 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/packages/test-globals/package.json b/packages/test-globals/package.json index 0d8b1d7aa591..55955f9434ca 100644 --- a/packages/test-globals/package.json +++ b/packages/test-globals/package.json @@ -12,7 +12,9 @@ "./package.json": "./package.json" }, "dependencies": { - "@jest/globals": "workspace:^", + "@jest/environment": "workspace:^", + "@jest/expect": "workspace:^", + "@jest/types": "workspace:^", "jest-mock": "workspace:^" }, "engines": { diff --git a/packages/test-globals/src/index.ts b/packages/test-globals/src/index.ts index 19f3dd0fbc3c..94eedd3e3520 100644 --- a/packages/test-globals/src/index.ts +++ b/packages/test-globals/src/index.ts @@ -5,6 +5,9 @@ * LICENSE file in the root directory of this source tree. */ +import type {Jest} from '@jest/environment'; +import type {JestExpect} from '@jest/expect'; +import type {Global} from '@jest/types'; import type { ClassLike, FunctionLike, @@ -17,26 +20,26 @@ import type { } from 'jest-mock'; declare global { - const beforeAll: typeof import('@jest/globals')['beforeAll']; - const beforeEach: typeof import('@jest/globals')['beforeEach']; + const beforeAll: Global.TestFrameworkGlobals['beforeAll']; + const beforeEach: Global.TestFrameworkGlobals['beforeEach']; - const afterEach: typeof import('@jest/globals')['afterEach']; - const afterAll: typeof import('@jest/globals')['afterAll']; + const afterEach: Global.TestFrameworkGlobals['afterEach']; + const afterAll: Global.TestFrameworkGlobals['afterAll']; - const describe: typeof import('@jest/globals')['describe']; - const fdescribe: typeof import('@jest/globals')['fdescribe']; - const xdescribe: typeof import('@jest/globals')['xdescribe']; + const describe: Global.TestFrameworkGlobals['describe']; + const fdescribe: Global.TestFrameworkGlobals['fdescribe']; + const xdescribe: Global.TestFrameworkGlobals['xdescribe']; - const it: typeof import('@jest/globals')['it']; - const fit: typeof import('@jest/globals')['fit']; - const xit: typeof import('@jest/globals')['xit']; + const it: Global.TestFrameworkGlobals['it']; + const fit: Global.TestFrameworkGlobals['fit']; + const xit: Global.TestFrameworkGlobals['xit']; - const test: typeof import('@jest/globals')['test']; - const xtest: typeof import('@jest/globals')['xtest']; + const test: Global.TestFrameworkGlobals['test']; + const xtest: Global.TestFrameworkGlobals['xtest']; - const expect: typeof import('@jest/globals')['expect']; + const expect: JestExpect; - const jest: typeof import('@jest/globals')['jest']; + const jest: Jest; // eslint-disable-next-line @typescript-eslint/no-namespace namespace jest { diff --git a/packages/test-globals/tsconfig.json b/packages/test-globals/tsconfig.json index 88ebc1efb2e0..5f17ca7fc22c 100644 --- a/packages/test-globals/tsconfig.json +++ b/packages/test-globals/tsconfig.json @@ -5,5 +5,10 @@ "outDir": "build" }, "include": ["./src/**/*"], - "references": [{"path": "../jest-globals"}, {"path": "../jest-mock"}] + "references": [ + {"path": "../jest-environment"}, + {"path": "../jest-expect"}, + {"path": "../jest-mock"}, + {"path": "../jest-types"} + ] } diff --git a/yarn.lock b/yarn.lock index 11ff523d2e35..c6a5fffc52b9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2909,7 +2909,9 @@ __metadata: version: 0.0.0-use.local resolution: "@jest/test-globals@workspace:packages/test-globals" dependencies: - "@jest/globals": "workspace:^" + "@jest/environment": "workspace:^" + "@jest/expect": "workspace:^" + "@jest/types": "workspace:^" jest-mock: "workspace:^" languageName: unknown linkType: soft From 46af508c023f0ac447fb97646447044512e5c5a9 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Fri, 30 Sep 2022 21:16:47 +0300 Subject: [PATCH 07/12] clean up --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index d2fb022ad239..360c57ab4600 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "@babel/register": "^7.0.0", "@crowdin/cli": "^3.5.2", "@jest/globals": "workspace:^", - "@jest/test-globals": "workspace:^", "@jest/test-utils": "workspace:^", "@lerna-lite/cli": "^1.11.3", "@microsoft/api-extractor": "^7.29.0", From 48115607bd610e2d965a83066d2a00902fad5001 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Fri, 30 Sep 2022 21:20:28 +0300 Subject: [PATCH 08/12] fix lock --- yarn.lock | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index c6a5fffc52b9..ed6b150b11a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2750,7 +2750,6 @@ __metadata: "@babel/register": ^7.0.0 "@crowdin/cli": ^3.5.2 "@jest/globals": "workspace:^" - "@jest/test-globals": "workspace:^" "@jest/test-utils": "workspace:^" "@lerna-lite/cli": ^1.11.3 "@microsoft/api-extractor": ^7.29.0 @@ -2905,7 +2904,7 @@ __metadata: languageName: unknown linkType: soft -"@jest/test-globals@workspace:^, @jest/test-globals@workspace:packages/test-globals": +"@jest/test-globals@workspace:packages/test-globals": version: 0.0.0-use.local resolution: "@jest/test-globals@workspace:packages/test-globals" dependencies: From 570a953ab3350f99327432d5e1d21d6d737a17a9 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Sat, 1 Oct 2022 08:17:10 +0300 Subject: [PATCH 09/12] rework config files --- packages/babel-jest/src/__tests__/tsconfig.json | 6 ++---- .../babel-plugin-jest-hoist/src/__tests__/tsconfig.json | 6 ++---- packages/diff-sequences/src/__tests__/tsconfig.json | 6 ++---- packages/expect-utils/src/__tests__/tsconfig.json | 6 ++---- packages/expect/src/__tests__/tsconfig.json | 6 ++---- packages/jest-circus/src/__tests__/tsconfig.json | 6 ++---- packages/jest-cli/src/__tests__/tsconfig.json | 6 ++---- packages/jest-cli/src/init/__tests__/tsconfig.json | 6 ++---- packages/jest-config/src/__tests__/tsconfig.json | 6 ++---- packages/jest-console/src/__tests__/tsconfig.json | 6 ++---- packages/jest-core/src/__tests__/tsconfig.json | 6 ++---- packages/jest-core/src/lib/__tests__/tsconfig.json | 6 ++---- packages/jest-core/src/plugins/__tests__/tsconfig.json | 6 ++---- .../src/__tests__/tsconfig.json | 6 ++---- packages/jest-diff/src/__tests__/tsconfig.json | 6 ++---- packages/jest-docblock/src/__tests__/tsconfig.json | 6 ++---- packages/jest-each/src/__tests__/tsconfig.json | 6 ++---- .../jest-environment-jsdom/src/__tests__/tsconfig.json | 6 ++---- .../jest-environment-node/src/__tests__/tsconfig.json | 6 ++---- packages/jest-fake-timers/src/__tests__/tsconfig.json | 6 ++---- packages/jest-get-type/src/__tests__/tsconfig.json | 6 ++---- packages/jest-globals/src/__tests__/tsconfig.json | 6 ++---- packages/jest-haste-map/src/__tests__/tsconfig.json | 6 ++---- .../jest-haste-map/src/crawlers/__tests__/tsconfig.json | 6 ++---- packages/jest-haste-map/src/lib/__tests__/tsconfig.json | 6 ++---- packages/jest-jasmine2/src/__tests__/tsconfig.json | 6 ++---- packages/jest-leak-detector/src/__tests__/tsconfig.json | 6 ++---- packages/jest-matcher-utils/src/__tests__/tsconfig.json | 6 ++---- packages/jest-message-util/src/__tests__/tsconfig.json | 6 ++---- packages/jest-mock/src/__tests__/tsconfig.json | 6 ++---- packages/jest-regex-util/src/__tests__/tsconfig.json | 6 ++---- packages/jest-repl/src/__tests__/tsconfig.json | 6 ++---- packages/jest-reporters/src/__tests__/tsconfig.json | 6 ++---- .../src/__tests__/tsconfig.json | 6 ++---- packages/jest-resolve/src/__tests__/tsconfig.json | 6 ++---- packages/jest-runner/src/__tests__/tsconfig.json | 6 ++---- packages/jest-runtime/src/__tests__/tsconfig.json | 6 ++---- packages/jest-snapshot/src/__tests__/tsconfig.json | 6 ++---- packages/jest-source-map/src/__tests__/tsconfig.json | 6 ++---- packages/jest-test-result/src/__tests__/tsconfig.json | 6 ++---- packages/jest-test-sequencer/src/__tests__/tsconfig.json | 6 ++---- packages/jest-transform/src/__tests__/tsconfig.json | 6 ++---- packages/jest-util/src/__tests__/tsconfig.json | 6 ++---- packages/jest-validate/src/__tests__/tsconfig.json | 6 ++---- packages/jest-watcher/src/lib/__tests__/tsconfig.json | 6 ++---- packages/jest-worker/src/base/__tests__/tsconfig.json | 6 ++---- packages/jest-worker/src/workers/__tests__/tsconfig.json | 6 ++---- packages/pretty-format/src/__tests__/tsconfig.json | 6 ++---- tsconfig.test.json | 9 +++++++++ 49 files changed, 105 insertions(+), 192 deletions(-) create mode 100644 tsconfig.test.json diff --git a/packages/babel-jest/src/__tests__/tsconfig.json b/packages/babel-jest/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/babel-jest/src/__tests__/tsconfig.json +++ b/packages/babel-jest/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/babel-plugin-jest-hoist/src/__tests__/tsconfig.json b/packages/babel-plugin-jest-hoist/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/babel-plugin-jest-hoist/src/__tests__/tsconfig.json +++ b/packages/babel-plugin-jest-hoist/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/diff-sequences/src/__tests__/tsconfig.json b/packages/diff-sequences/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/diff-sequences/src/__tests__/tsconfig.json +++ b/packages/diff-sequences/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/expect-utils/src/__tests__/tsconfig.json b/packages/expect-utils/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/expect-utils/src/__tests__/tsconfig.json +++ b/packages/expect-utils/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/expect/src/__tests__/tsconfig.json b/packages/expect/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/expect/src/__tests__/tsconfig.json +++ b/packages/expect/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-circus/src/__tests__/tsconfig.json b/packages/jest-circus/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-circus/src/__tests__/tsconfig.json +++ b/packages/jest-circus/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-cli/src/__tests__/tsconfig.json b/packages/jest-cli/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-cli/src/__tests__/tsconfig.json +++ b/packages/jest-cli/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-cli/src/init/__tests__/tsconfig.json b/packages/jest-cli/src/init/__tests__/tsconfig.json index 13aa0afc4960..406e8d978e62 100644 --- a/packages/jest-cli/src/init/__tests__/tsconfig.json +++ b/packages/jest-cli/src/init/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.json", + "extends": "../../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../../" }, "include": ["../**/*"] } diff --git a/packages/jest-config/src/__tests__/tsconfig.json b/packages/jest-config/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-config/src/__tests__/tsconfig.json +++ b/packages/jest-config/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-console/src/__tests__/tsconfig.json b/packages/jest-console/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-console/src/__tests__/tsconfig.json +++ b/packages/jest-console/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-core/src/__tests__/tsconfig.json b/packages/jest-core/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-core/src/__tests__/tsconfig.json +++ b/packages/jest-core/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-core/src/lib/__tests__/tsconfig.json b/packages/jest-core/src/lib/__tests__/tsconfig.json index 13aa0afc4960..406e8d978e62 100644 --- a/packages/jest-core/src/lib/__tests__/tsconfig.json +++ b/packages/jest-core/src/lib/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.json", + "extends": "../../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../../" }, "include": ["../**/*"] } diff --git a/packages/jest-core/src/plugins/__tests__/tsconfig.json b/packages/jest-core/src/plugins/__tests__/tsconfig.json index 13aa0afc4960..406e8d978e62 100644 --- a/packages/jest-core/src/plugins/__tests__/tsconfig.json +++ b/packages/jest-core/src/plugins/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.json", + "extends": "../../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../../" }, "include": ["../**/*"] } diff --git a/packages/jest-create-cache-key-function/src/__tests__/tsconfig.json b/packages/jest-create-cache-key-function/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-create-cache-key-function/src/__tests__/tsconfig.json +++ b/packages/jest-create-cache-key-function/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-diff/src/__tests__/tsconfig.json b/packages/jest-diff/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-diff/src/__tests__/tsconfig.json +++ b/packages/jest-diff/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-docblock/src/__tests__/tsconfig.json b/packages/jest-docblock/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-docblock/src/__tests__/tsconfig.json +++ b/packages/jest-docblock/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-each/src/__tests__/tsconfig.json b/packages/jest-each/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-each/src/__tests__/tsconfig.json +++ b/packages/jest-each/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-environment-jsdom/src/__tests__/tsconfig.json b/packages/jest-environment-jsdom/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-environment-jsdom/src/__tests__/tsconfig.json +++ b/packages/jest-environment-jsdom/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-environment-node/src/__tests__/tsconfig.json b/packages/jest-environment-node/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-environment-node/src/__tests__/tsconfig.json +++ b/packages/jest-environment-node/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-fake-timers/src/__tests__/tsconfig.json b/packages/jest-fake-timers/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-fake-timers/src/__tests__/tsconfig.json +++ b/packages/jest-fake-timers/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-get-type/src/__tests__/tsconfig.json b/packages/jest-get-type/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-get-type/src/__tests__/tsconfig.json +++ b/packages/jest-get-type/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-globals/src/__tests__/tsconfig.json b/packages/jest-globals/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-globals/src/__tests__/tsconfig.json +++ b/packages/jest-globals/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-haste-map/src/__tests__/tsconfig.json b/packages/jest-haste-map/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-haste-map/src/__tests__/tsconfig.json +++ b/packages/jest-haste-map/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-haste-map/src/crawlers/__tests__/tsconfig.json b/packages/jest-haste-map/src/crawlers/__tests__/tsconfig.json index 13aa0afc4960..406e8d978e62 100644 --- a/packages/jest-haste-map/src/crawlers/__tests__/tsconfig.json +++ b/packages/jest-haste-map/src/crawlers/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.json", + "extends": "../../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../../" }, "include": ["../**/*"] } diff --git a/packages/jest-haste-map/src/lib/__tests__/tsconfig.json b/packages/jest-haste-map/src/lib/__tests__/tsconfig.json index 13aa0afc4960..406e8d978e62 100644 --- a/packages/jest-haste-map/src/lib/__tests__/tsconfig.json +++ b/packages/jest-haste-map/src/lib/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.json", + "extends": "../../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../../" }, "include": ["../**/*"] } diff --git a/packages/jest-jasmine2/src/__tests__/tsconfig.json b/packages/jest-jasmine2/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-jasmine2/src/__tests__/tsconfig.json +++ b/packages/jest-jasmine2/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-leak-detector/src/__tests__/tsconfig.json b/packages/jest-leak-detector/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-leak-detector/src/__tests__/tsconfig.json +++ b/packages/jest-leak-detector/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-matcher-utils/src/__tests__/tsconfig.json b/packages/jest-matcher-utils/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-matcher-utils/src/__tests__/tsconfig.json +++ b/packages/jest-matcher-utils/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-message-util/src/__tests__/tsconfig.json b/packages/jest-message-util/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-message-util/src/__tests__/tsconfig.json +++ b/packages/jest-message-util/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-mock/src/__tests__/tsconfig.json b/packages/jest-mock/src/__tests__/tsconfig.json index 2ac9dcb9f603..8ccc3083ffb0 100644 --- a/packages/jest-mock/src/__tests__/tsconfig.json +++ b/packages/jest-mock/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals", "node"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-regex-util/src/__tests__/tsconfig.json b/packages/jest-regex-util/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-regex-util/src/__tests__/tsconfig.json +++ b/packages/jest-regex-util/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-repl/src/__tests__/tsconfig.json b/packages/jest-repl/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-repl/src/__tests__/tsconfig.json +++ b/packages/jest-repl/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-reporters/src/__tests__/tsconfig.json b/packages/jest-reporters/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-reporters/src/__tests__/tsconfig.json +++ b/packages/jest-reporters/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-resolve-dependencies/src/__tests__/tsconfig.json b/packages/jest-resolve-dependencies/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-resolve-dependencies/src/__tests__/tsconfig.json +++ b/packages/jest-resolve-dependencies/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-resolve/src/__tests__/tsconfig.json b/packages/jest-resolve/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-resolve/src/__tests__/tsconfig.json +++ b/packages/jest-resolve/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-runner/src/__tests__/tsconfig.json b/packages/jest-runner/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-runner/src/__tests__/tsconfig.json +++ b/packages/jest-runner/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-runtime/src/__tests__/tsconfig.json b/packages/jest-runtime/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-runtime/src/__tests__/tsconfig.json +++ b/packages/jest-runtime/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-snapshot/src/__tests__/tsconfig.json b/packages/jest-snapshot/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-snapshot/src/__tests__/tsconfig.json +++ b/packages/jest-snapshot/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-source-map/src/__tests__/tsconfig.json b/packages/jest-source-map/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-source-map/src/__tests__/tsconfig.json +++ b/packages/jest-source-map/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-test-result/src/__tests__/tsconfig.json b/packages/jest-test-result/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-test-result/src/__tests__/tsconfig.json +++ b/packages/jest-test-result/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-test-sequencer/src/__tests__/tsconfig.json b/packages/jest-test-sequencer/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-test-sequencer/src/__tests__/tsconfig.json +++ b/packages/jest-test-sequencer/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-transform/src/__tests__/tsconfig.json b/packages/jest-transform/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-transform/src/__tests__/tsconfig.json +++ b/packages/jest-transform/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-util/src/__tests__/tsconfig.json b/packages/jest-util/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-util/src/__tests__/tsconfig.json +++ b/packages/jest-util/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-validate/src/__tests__/tsconfig.json b/packages/jest-validate/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-validate/src/__tests__/tsconfig.json +++ b/packages/jest-validate/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/jest-watcher/src/lib/__tests__/tsconfig.json b/packages/jest-watcher/src/lib/__tests__/tsconfig.json index 105289d8abbd..406e8d978e62 100644 --- a/packages/jest-watcher/src/lib/__tests__/tsconfig.json +++ b/packages/jest-watcher/src/lib/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.json", + "extends": "../../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../../", - "types": ["@jest/test-globals"] + "rootDir": "../../" }, "include": ["../**/*"] } diff --git a/packages/jest-worker/src/base/__tests__/tsconfig.json b/packages/jest-worker/src/base/__tests__/tsconfig.json index 13aa0afc4960..406e8d978e62 100644 --- a/packages/jest-worker/src/base/__tests__/tsconfig.json +++ b/packages/jest-worker/src/base/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.json", + "extends": "../../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../../" }, "include": ["../**/*"] } diff --git a/packages/jest-worker/src/workers/__tests__/tsconfig.json b/packages/jest-worker/src/workers/__tests__/tsconfig.json index 13aa0afc4960..3ed459489903 100644 --- a/packages/jest-worker/src/workers/__tests__/tsconfig.json +++ b/packages/jest-worker/src/workers/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.json", + "extends": "../../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/packages/pretty-format/src/__tests__/tsconfig.json b/packages/pretty-format/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/pretty-format/src/__tests__/tsconfig.json +++ b/packages/pretty-format/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 000000000000..69a0977f451e --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "types": ["@jest/test-globals"] + } +} From 2d60a2b48db48f81e83305fbea8327fe74f49307 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Sat, 1 Oct 2022 08:46:34 +0300 Subject: [PATCH 10/12] missed one --- packages/jest-worker/src/__tests__/tsconfig.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/jest-worker/src/__tests__/tsconfig.json b/packages/jest-worker/src/__tests__/tsconfig.json index 75f0b8c12a33..8ccc3083ffb0 100644 --- a/packages/jest-worker/src/__tests__/tsconfig.json +++ b/packages/jest-worker/src/__tests__/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.json", + "extends": "../../../../tsconfig.test.json", "compilerOptions": { - "composite": false, - "rootDir": "../", - "types": ["@jest/test-globals"] + "rootDir": "../" }, "include": ["../**/*"] } From 6cb1488ee181bc9fb0f103ddc9917a5a658c97a4 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Sat, 1 Oct 2022 08:51:05 +0300 Subject: [PATCH 11/12] tweak e2e config --- e2e/tsconfig.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/e2e/tsconfig.json b/e2e/tsconfig.json index bc234a9fa790..c3053b6da00f 100644 --- a/e2e/tsconfig.json +++ b/e2e/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.test.json", "compilerOptions": { - "composite": false, - "types": ["@jest/test-globals"] + "rootDir": "./" }, - "include": ["../**/*"] + "include": ["./**/*"] } From dcd66d0a3c91db3d1d4dcf756f58aa46071109fe Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Sat, 1 Oct 2022 10:32:14 +0300 Subject: [PATCH 12/12] fix lint --- examples/typescript/__tests__/sub-test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/typescript/__tests__/sub-test.ts b/examples/typescript/__tests__/sub-test.ts index e3330c8b8c95..b6ccb828f104 100644 --- a/examples/typescript/__tests__/sub-test.ts +++ b/examples/typescript/__tests__/sub-test.ts @@ -1,7 +1,7 @@ // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. -import sub from '../sub'; import {expect, it} from '@jest/globals'; +import sub from '../sub'; it('subtracts 5 - 1 to equal 4 in TypeScript', () => { expect(sub(5, 1)).toBe(4);