[Bug]: Tests failed due to error "registerer.enabled is not a function"
belyan opened this issue · comments
Version
27.1.4
Steps to reproduce
- Create new angular app with NX 14.0.5
- Run tests with command
nx run my-app:test
Expected behavior
Jest tests are passed without any errors.
Actual behavior
Tests failed with error
Jest: Failed to parse the TypeScript config file /var/teamcity/agent/work/511c4cac333fab38/libs/***/jest.config.ts
[18:05:11] TypeError: registerer.enabled is not a function
Debug log
Log file is not created
Additional context
Environment
System:
OS: macOS Sierra 10.12.6
CPU: (8) x64 Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
Binaries:
Node: 16.14.2 - /usr/local/bin/node
npm: 8.5.0 - /usr/local/bin/npm
npmPackages:
jest: 27.5.1 => 27.5.1
This error isn’t related to ts-jest
, the error indicates about something with ts-node
. You should check with Jest community or search a bit more on google or debug to see what happened.
In general this error happens when you use Jest config in TypeScript which Jest uses ts-node
to process that file.
ts-jest
is code transformation which means it only executes on test files or files which are imported by test files, see more at https://jestjs.io/docs/code-transformation