Skip to content

Types acquisition seems to be broken after upgrading from 4.8.3 to 4.8.4Β #50984

@ernestostifano

Description

@ernestostifano

Bug Report

πŸ”Ž Search Terms

v4.8.4 was released yesterday, so I just looked at the last 24h issues and found none.

πŸ•— Version & Regression Information

  • This changed between versions 4.8.3 and 4.8.4

⏯ Playground Link

N/A.

πŸ’» Code

my-test.test.ts

describe('Hello, World!', () => {
    it('should have correct value', () => {
        expect("Hello, World!").toEqual('Hello, World!');
    });
});
Errors
TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
TS2304: Cannot find name 'expect'.
Installed Types
{
    "@types/jest": "29.0.0",
    "@types/node": "18.7.0",
    "@types/react": "^18.0.20",
    "@types/react-dom": "^18.0.6",
    "@types/testing-library__jest-dom": "^5.14.5"
}
Typescript Config

tsconfig.base.js

{
    "compilerOptions": {
        "target": "ESNext",
        "module": "ESNext",
        "moduleResolution": "Node",
        "resolveJsonModule": true,
        "allowUnreachableCode": false,
        "lib": ["ESNext"],
        "allowJs": false,
        "checkJs": false,
        "noEmit": false,
        "noEmitOnError": true,
        "declaration": true,
        "emitDeclarationOnly": true,
        "declarationMap": true,
        "strict": true,
        "noImplicitAny": true,
        "strictNullChecks": true,
        "esModuleInterop": false,
        "forceConsistentCasingInFileNames": true,
        "useDefineForClassFields": true,
        "removeComments": false,
        "allowSyntheticDefaultImports": true
    }
}

tsconfig.js

{
    "extends": "../../tsconfig.base.json",
    "compilerOptions": {
        "declarationDir": "./types"
    },
    "files": ["./src/index.ts"],
    "include": ["./tsconfig.d.ts", "./src/jest.setup.ts", "**/*.test.ts"]
}

πŸ™ Actual behavior

describe, it and expect are not recognised even if Jest type definitions are installed.

Everything was working fine until v4.8.4, changing ^4.8.3 with 4.8.3 fixes the issue.

πŸ™‚ Expected behavior

Jest types to be properly recognised.

Metadata

Metadata

Assignees

Labels

ExternalRelates to another program, environment, or user action which we cannot control.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions