Nx does not recognize existing jest.preset files if using .cjs or .mjs #20449
Labels
outdated
scope: testing tools
Issues related to Cypress / Jest / Playwright / Vitest support in Nx
type: bug
Current Behavior
Using NX within an ESM based project, renaming jest.preset.js to jest.preset.cjs to add support for the jest preset file in cjs form.
Every time a NX generate command is ran ie:
@nx/angular:library
, nx does not recognize the existingjest.preset.cjs
file and generates a newjest.preset.js
file.With every library creation, the generated
jest.preset.js
has to be deleted from project root and have to modify the generatedjest.config.ts
file within the new library with the correctpreset
path to jest presetExpected Behavior
Recognize all accepted jest.preset file extensions
jest-preset.json
,jest-preset.js
,jest-preset.cjs
orjest-preset.mjs
(https://jestjs.io/docs/configuration) from project root.GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
No response
Package Manager Version
pnpm 8.9.2
Operating System
Additional Information
Tried editing the jest config file as shown below to see if NX recognizes the changed file. The config file has no effect on nx generate behavior and the issue is still reproduced.
The text was updated successfully, but these errors were encountered: