Skip to content

Is @types/jest-environment-puppeteer still required? #568

@pyoor

Description

@pyoor

After updating jest-environment-puppeteer to 9.0.1, I get the following typescript compiler error:
error TS2304: Cannot find name 'page'.

The README notes that typescript definitions are now provided for jest-puppeteer versions > v8.0.0. However, the only way I'm able to resolve the issue is by installing the @types/jest-environment-puppeteer. Is this something wrong with my configuration?

Relevant dependencies:

    "@jest/globals": "^29.7.0",
    "jest": "^29.7.0",
    "jest-environment-puppeteer": "^9.0.1",
    "puppeteer-core": "^21.4.1",
    "ts-jest": "^29.1.1",
    "typescript": "^5.2.2"

tsconfig.json:

{
  "compilerOptions": {
    "noEmit": true,
    "esModuleInterop": true,
    "module": "commonjs",
    "resolveJsonModule": true,
    "target": "ES2022",
    "lib": [
      "ES2022",
      "DOM"
    ],
    "strict": false,
  }
}

jest.config.ts

export default {
  preset: "ts-jest",
  globalSetup: "jest-environment-puppeteer/setup",
  globalTeardown: "jest-environment-puppeteer/teardown",
  testEnvironment: "jest-environment-puppeteer",
  testTimeout: 30000,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions