Closed amin3mej closed 21 hours ago
I managed to fix it in this way:
I had a have a jest.config.ts
like this:
export default {
displayName: 'my-app-name,
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['../../jest.setup.ts'],
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/my-app-name',
}
and I changed it to this:
export default {
displayName: 'my-app-name,
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['../../jest.setup.ts'],
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-transform-class-properties', { loose: true }],
],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/my-app-name',
}
Current Behavior
Getting this error while trying to run tests:
Expected Behavior
It should not trigger any error like before the upgrade.
GitHub Repo
No response
Steps to Reproduce
19.5.7
to20.1.2
and the tests that have using decorators started failing.Similar to https://github.com/nrwl/nx/discussions/27533
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response