Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added an option to disable ts-node #15161

Merged
merged 16 commits into from
Jul 12, 2024
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- `[jest-config]` [**BREAKING**] Update `testMatch` and `testRegex` default option for supporting `mjs`, `cjs`, `mts`, and `cts` ([#14584](https://github.com/jestjs/jest/pull/14584))
- `[jest-config]` Loads config file from provided path in `package.json` ([#14044](https://github.com/facebook/jest/pull/14044))
- `[jest-config]` Allow loading `jest.config.cts` files ([#14070](https://github.com/facebook/jest/pull/14070))
- `[jest-config]` Added an option to disable `ts-node` typechecking ([#15161](https://github.com/jestjs/jest/pull/15161))
- `[@jest/core]` Group together open handles with the same stack trace ([#13417](https://github.com/jestjs/jest/pull/13417), & [#14789](https://github.com/jestjs/jest/pull/14789))
- `[@jest/core]` Add `perfStats` to surface test setup overhead ([#14622](https://github.com/jestjs/jest/pull/14622))
- `[@jest/core]` [**BREAKING**] Changed `--filter` to accept an object with shape `{ filtered: Array<string> }` to match [documentation](https://jestjs.io/docs/cli#--filterfile) ([#13319](https://github.com/jestjs/jest/pull/13319))
Expand Down
2 changes: 2 additions & 0 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export default async (): Promise<Config> => {

To read TypeScript configuration files Jest requires [`ts-node`](https://npmjs.com/package/ts-node). Make sure it is installed in your project.

To read configuration files without typechecking, You can set `JEST_CONFIG_TRANSPILE_ONLY` environment variable to `true` (case insensitive).

:::

The configuration also can be stored in a JSON file as a plain object:
Expand Down
34 changes: 32 additions & 2 deletions e2e/__tests__/jest.config.ts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,42 @@
test('it does type check the config', () => {
writeFiles(DIR, {
'__tests__/a-giraffe.js': "test('giraffe', () => expect(1).toBe(1));",
'jest.config.ts': 'export default { testTimeout: "10000" }',
'jest.config.ts': `
import {Config} from 'jest';
const config: Config = { testTimeout: "10000" };
export default config;
`,
'package.json': '{}',
});

const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false']);
expect(stderr).toMatch('must be of type');
expect(stderr).toMatch(

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node LTS using jest-jasmine2

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node LTS using jest-jasmine2

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node LTS using jest-jasmine2

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Node LTS on Ubuntu with coverage (1/4)

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Node LTS on Ubuntu with coverage (1/4)

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Node LTS on Ubuntu with coverage (1/4)

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node LTS using jest-jasmine2

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node LTS using jest-jasmine2

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node LTS using jest-jasmine2

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node v16.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node v16.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node v16.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node v18.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node v18.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node v18.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node v21.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node v21.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node v21.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node v16.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node v16.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node v16.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node v20.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node v20.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node v20.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node v18.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node v18.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node v18.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node v20.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node v20.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node v20.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node v22.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node v22.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Ubuntu with shard 1/4 / Node v22.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /home/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/home/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/home/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/home/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/home/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/home/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/home/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node v21.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node v21.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node v21.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node v22.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node v22.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / macOS with shard 1/3 / Node v22.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file /Users/runner/work/jest/jest/e2e/jest-config-ts/jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. '/Users/runner/work/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`· at readConfigFileAndSetRootDir (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:2242:13) at async readInitialOptions (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1153:13) at async readConfig (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:924:7) at async readConfigs (/Users/runner/work/jest/jest/packages/jest-config/build/index.js:1174:26) at async runCLI (/Users/runner/work/jest/jest/packages/jest-core/build/index.js:1384:7) at async Object.run (/Users/runner/work/jest/jest/packages/jest-cli/build/index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node v16.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node v16.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node v16.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node v20.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node v20.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node v20.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node v18.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node v18.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node v18.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node v22.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node v22.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node v22.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node v21.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node v21.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node v21.x

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node LTS using jest-jasmine2

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node LTS using jest-jasmine2

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)

Check failure on line 88 in e2e/__tests__/jest.config.ts.test.ts

View workflow job for this annotation

GitHub Actions / Windows with shard 1/4 / Node LTS using jest-jasmine2

it does type check the config

expect(received).toMatch(expected) Expected substring: "TS2322: Type 'string' is not assignable to type 'number'." Received string: "Error: Jest: Failed to parse the TypeScript config file D:\\a\\jest\\jest\\e2e\\jest-config-ts\\jest.config.ts TSError: ⨯ Unable to compile TypeScript: jest.config.ts(1,22): error TS7016: Could not find a declaration file for module 'jest'. 'D:/a/jest/jest/packages/jest/build/index.js' implicitly has an 'any' type.· Try `npm i --save-dev @types/jest` if it exists or add a new declaration (.d.ts) file containing `declare module 'jest';`·· at readConfigFileAndSetRootDir (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:2242:13) at async readInitialOptions (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1153:13) at async readConfig (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:924:7) at async readConfigs (D:\\a\\jest\\jest\\packages\\jest-config\\build\\index.js:1174:26) at async runCLI (D:\\a\\jest\\jest\\packages\\jest-core\\build\\index.js:1384:7) at async Object.run (D:\\a\\jest\\jest\\packages\\jest-cli\\build\\index.js:657:9)" at Object.toMatch (e2e/__tests__/jest.config.ts.test.ts:88:18)
"TS2322: Type 'string' is not assignable to type 'number'.",
);
expect(stderr).not.toMatch('Option "testTimeout" must be of type:');
expect(exitCode).toBe(1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test didn't actually produce a type error

});

test('it can ignore type errors the config', () => {
writeFiles(DIR, {
'__tests__/a-giraffe.js': "test('giraffe', () => expect(1).toBe(1));",
'jest.config.ts': `
import {Config} from 'jest';
const config: Config = { testTimeout: "10000" };
export default config;
`,
'package.json': '{}',
});

const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false'], {
env: {
JEST_CONFIG_TRANSPILE_ONLY: 'true',
},
});
expect(stderr).not.toMatch(
"TS2322: Type 'string' is not assignable to type 'number'.",
);
expect(stderr).toMatch('Option "testTimeout" must be of type:');
expect(exitCode).toBe(1);
});

Expand Down
10 changes: 8 additions & 2 deletions packages/jest-config/src/readConfigFileAndSetRootDir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import * as path from 'path';
import {isNativeError} from 'util/types';
import * as fs from 'graceful-fs';
import parseJson = require('parse-json');
import stripJsonComments = require('strip-json-comments');
Expand Down Expand Up @@ -124,9 +125,14 @@ async function registerTsNode(): Promise<Service> {
moduleTypes: {
'**': 'cjs',
},
transpileOnly:
process.env.JEST_CONFIG_TRANSPILE_ONLY?.toLowerCase() === 'true',
});
} catch (error: any) {
if (error.code === 'ERR_MODULE_NOT_FOUND') {
} catch (error) {
if (
isNativeError(error) &&
(error as NodeJS.ErrnoException).code === 'ERR_MODULE_NOT_FOUND'
) {
throw new Error(
`Jest: 'ts-node' is required for the TypeScript configuration files. Make sure it is installed\nError: ${error.message}`,
);
Expand Down
Loading