-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathjest.preset.js
More file actions
24 lines (23 loc) · 1.06 KB
/
Copy pathjest.preset.js
File metadata and controls
24 lines (23 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const nxPreset = require('@nx/jest/preset').default
module.exports = {
...nxPreset,
/* TODO: Update to latest Jest snapshotFormat
* By default Nx has kept the older style of Jest Snapshot formats
* to prevent breaking of any existing tests with snapshots.
* It's recommend you update to the latest format.
* You can do this by removing snapshotFormat property
* and running tests with --update-snapshot flag.
* Example: "nx affected --targets=test --update-snapshot"
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
*/
snapshotFormat: { escapeString: true, printBasicPrototype: true },
passWithNoTests: true,
moduleNameMapper: {
...(nxPreset.moduleNameMapper || {}),
// Force all React/ReactDOM imports to use the same version
// This prevents conflicts when packages like @visx/xychart bundle their own React
// Use path relative to workspace root (../../node_modules from project root)
'^react$': '<rootDir>/../../node_modules/react',
'^react-dom$': '<rootDir>/../../node_modules/react-dom',
},
}