const nxPreset = require('@nx/jest/preset').default; module.exports = { ...nxPreset, testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'], transform: { '^.+\\.(ts|mjs|js|html)$': [ 'jest-preset-angular', { tsconfig: '/tsconfig.spec.json', stringifyContentPathRegex: '\\.(html|svg)$', }, ], }, transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], resolver: '@nx/jest/plugins/resolver', moduleFileExtensions: ['ts', 'js', 'html'], globals: {}, snapshotSerializers: [ 'jest-preset-angular/build/serializers/no-ng-attributes', 'jest-preset-angular/build/serializers/ng-snapshot', 'jest-preset-angular/build/serializers/html-comment', ], /* 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 }, };