Skip to content

fix(tests): drop unused ts-jest transform from shared jest preset - #382

Open
deejayem wants to merge 1 commit into
open-constructs:mainfrom
deejayem:fix-jest-preset-ts-jest
Open

fix(tests): drop unused ts-jest transform from shared jest preset#382
deejayem wants to merge 1 commit into
open-constructs:mainfrom
deejayem:fix-jest-preset-ts-jest

Conversation

@deejayem

Copy link
Copy Markdown

nxPreset registers a ts-jest transform, but every project in this workspace overrides it with its own @swc/jest transform, so the entry is resolved by jest at startup yet never executed. ts-jest is not a dependency of any of these projects — it is only pulled in transitively by one example's devDependencies — so any install that does not include that example (e.g. pnpm install --filter "cdktn-cli...") makes every test run fail at config load with "Module ts-jest in the transform option was not found".

Override the inherited transform with an empty map; each project supplies its own.

Related issue

Fixes #381

Description

Make the jest.preset.js transform an empty map.

Checklist

  • I have updated the PR title to match CDKTN's style guide
  • I have run the linter on my code locally
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas - n/a, the change is too small to need it
  • I have made corresponding changes to the documentation if applicable - n/a, none needed
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works if applicable - n/a, this is tested by existing tests passing when using --filter
  • New and existing unit tests pass locally with my changes

nxPreset registers a ts-jest transform, but every project in this
workspace overrides it with its own @swc/jest transform, so the entry
is resolved by jest at startup yet never executed. ts-jest is not a
dependency of any of these projects — it is only pulled in
transitively by one example's devDependencies — so any install that
does not include that example (e.g. `pnpm install --filter
"cdktn-cli..."`) makes every test run fail at config load with
"Module ts-jest in the transform option was not found".

Override the inherited transform with an empty map; each project
supplies its own.

Fixes open-constructs#381
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests: jest fails to start after a filtered pnpm install ("Module ts-jest in the transform option was not found")

1 participant