jest --config ./jest.config.js
ts-jest[config] (WARN) The configuration for astTransformers as string[] is deprecated and will be removed in ts-jest 27. Please define your custom AST transformers in a form of an object. More information you can check online documentation https://kulshekhar.github.io/ts-jest/user/config/astTransformers
ts-jest[config] (WARN) The configuration for astTransformers as string[] is deprecated and will be removed in ts-jest 27. Please define your custom AST transformers in a form of an object. More information you can check online documentation https://kulshekhar.github.io/ts-jest/user/config/astTransformers
System:
OS:
Npm packages:
jest: last
jest-preset-angular: last
typescript: last
This warning is due to change in ts-jest. Reference here. It can be easily fixed by changing your jest config to something like the following:
globals: {
'ts-jest': {
// ...
astTransformers: {
before: [
'jest-preset-angular/build/InlineFilesTransformer',
'jest-preset-angular/build/StripStylesTransformer',
],
},
},
},
We should change documentation in this repo.
Yes it is a change in ts-jest configuration for astTransformers.
PR is welcome :)
not sure what version worked with proposed solution, but on v26.4.0 this change to object proposed by @mmeylan throws:
```
TypeError: path.startsWith is not a function
at ConfigSet.resolvePath (node_modules/ts-jest/dist/config/config-set.js:717:18)
at node_modules/ts-jest/dist/config/config-set.js:175:41
at Array.map (<anonymous>)
at ConfigSet.get (node_modules/ts-jest/dist/config/config-set.js:174:49)
at ConfigSet.<anonymous> (node_modules/ts-jest/dist/utils/memoize.js:44:24)
at ConfigSet.get (node_modules/ts-jest/dist/config/config-set.js:364:37)
at ConfigSet.<anonymous> (node_modules/ts-jest/dist/utils/memoize.js:44:24)
at ConfigSet.get (node_modules/ts-jest/dist/config/config-set.js:583:50)
at ConfigSet.<anonymous> (node_modules/ts-jest/dist/utils/memoize.js:44:24)
at ConfigSet.get (node_modules/ts-jest/dist/config/config-set.js:603:25)```
if you install 8.3.1, it should fix the issue.
Most helpful comment
This warning is due to change in
ts-jest. Reference here. It can be easily fixed by changing your jest config to something like the following:We should change documentation in this repo.