jest-preset-angular
Advanced tools
Changelog
9.0.0-next.1 (2020-10-29)
jest-preset-angular
now switches to default to use its own transformer which wraps around ts-jest
to transform codes.Users who are currently doing in jest config
// jest.config.js
module.exports = {
// [...]
transform: {
'^.+\\.(ts|js|html)$': 'ts-jest',
},
}
should change to
// jest.config.js
module.exports = {
// [...]
transform: {
'^.+\\.(ts|js|html)$': 'jest-preset-angular',
},
}
Changelog
9.0.0-next.0 (2020-10-18)
We are working on Ivy compatibility for this preset. This requires introducing a different Jest transformer than the default
one from ts-jest
. To get updates on this work, please subscribe to #409
import 'jest-preset-angular'
should change to import 'jest-preset-angular/setup-jest'
InlineFilesTransformer
and StripStylesTransformer
are REMOVED and default jest-preset-angular
uses AST transformers from @angular/compiler-cli
. One should remove the old transformers from the jest config.jest-preset-angular
snapshot serializers should change jest config to have:// jest.config.js
const jestPresetAngularSerializers = require('jest-preset-angular/build/serializers')
module.exports = {
// [...]
snapshotSerializers: jestPresetAngularSerializers,
}
One is using one of jest-preset-angular
snapshot serializers should change jest config to have:
// jest.config.js
module.exports = {
// [...]
snapshotSerializers: [
'jest-preset-angular/build/serializers/html-comment'
]
}
or
// package.json
{
// [...]
"jest": {
snapshotSerializers: [
"jest-preset-angular/build/serializers/html-comment"
]
}
}