-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Avoid transformer conflict – ts-jest preset is currently bypassed
Setting preset: 'ts-jest' wires up ts-jest’s own transformer, but the explicit transform rule below (line 12-14) overrides it with babel-jest, so TypeScript files will no longer pass through ts-jest.
Pick one tool and delete the other to prevent invisible compile / type-checking gaps.
- preset: 'ts-jest',
- ...
- transform: {
- '^.+\\.(js|jsx|ts|tsx)$': 'babel-jest',
- },
+ // Option A – keep ts-jest (type-checking, respects tsconfig):
+ preset: 'ts-jest',
+ // ts-jest already provides a transform – remove custom “transform”.
+
+ // Option B – keep babel-jest (faster, no type-checking):
+ // preset: undefined,
+ transform: {
+ '^.+\\.(js|jsx|ts|tsx)$': 'babel-jest',
+ },Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In jest.config.js around lines 3 to 14, there is a conflict between the
'ts-jest' preset and the explicit 'transform' setting using 'babel-jest',
causing TypeScript files to bypass ts-jest's transformer. To fix this, either
remove the 'preset: ts-jest' line to rely solely on babel-jest for
transformation or delete the explicit 'transform' configuration to use ts-jest's
transformer exclusively, ensuring consistent TypeScript compilation and
type-checking.
Originally posted by @coderabbitai[bot] in #9 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels