Skip to content

fix: @types/jest version targets TypeScript 4.9 while project uses TypeScript 5 #375

@thewealthyplace

Description

@thewealthyplace

Bug

frontend/package.json has:

"typescript": "^5",
"@types/jest": "^29.5.12"

@types/jest@29.5.x targets TypeScript 4.9 compatibility. While it works with TypeScript 5, it does not take advantage of TypeScript 5's improved type inference and may generate spurious type errors or miss type narrowing opportunities in test files.

Additionally, ts-jest (if used) or jest transform configuration may need updating to align with TypeScript 5 module resolution.

Fix

Upgrade @types/jest to the latest version that explicitly supports TypeScript 5:

npm install --save-dev @types/jest@latest

Also verify tsconfig.json used by Jest (often tsconfig.test.json or a jest.config.ts reference) specifies "moduleResolution": "bundler" or "node16" as appropriate for TS5.

Run npm test after upgrading to confirm no regressions.

Acceptance Criteria

  • @types/jest upgraded to a version that explicitly supports TypeScript 5
  • npm test passes after upgrade with no new type errors
  • tsconfig.json uses TypeScript 5-compatible module resolution
  • CI passes after the change

References

  • frontend/package.json
  • frontend/tsconfig.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions