Jest configuration preset for Angular projects.
MIT License
Bot releases are visible (Hide)
Published by github-actions[bot] almost 3 years ago
Published by github-actions[bot] almost 3 years ago
Published by github-actions[bot] almost 3 years ago
Published by github-actions[bot] almost 3 years ago
Published by github-actions[bot] almost 3 years ago
Published by github-actions[bot] about 3 years ago
Published by ahnpnl about 3 years ago
Published by github-actions[bot] about 3 years ago
Published by github-actions[bot] about 3 years ago
Published by github-actions[bot] over 3 years ago
Published by github-actions[bot] over 3 years ago
Published by github-actions[bot] over 3 years ago
Published by github-actions[bot] over 3 years ago
Published by github-actions[bot] over 3 years ago
Published by github-actions[bot] over 3 years ago
moduleNameMapper
config (#910) (df482bc), closes #908
exports
field to package.json
, see https://nodejs.org/api/packages.html#packages_package_entry_points
presets
entry point (#801) (e4ff0c0)replace-resources
AST transformer from Angular (#708) (1b20c19)downlevel-ctor
AST transformer from Angular (#730) (1f964c3)cacheFS
from jest to reduce file system reading (#679) (f5d9d4b)skipLibCheck: true
if not defined in tsconfig (#678) (0df3ce1)import 'jest-preset-angular'
should change to import 'jest-preset-angular/setup-jest'
InlineFilesTransformer
and StripStylesTransformer
are REMOVED andjest-preset-angular
uses AST transformers from @angular/compiler-cli
and @ngtools/webpack
.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',
},
}
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js'
is changed to 'jest-preset-angular/build/serializers/no-ng-attributes
.'jest-preset-angular/build/AngularSnapshotSerializer.js'
is changed to 'jest-preset-angular/build/serializers/ng-snapshot
.'jest-preset-angular/build/HTMLCommentSerializer.js'
is changed to 'jest-preset-angular/build/serializers/html-comment
.tsconfig.json
doesn't contain any path mappingsmoduleNameMapper
from preset will make sure that the preset works in pair with tsconfig.json
.moduleNameMapper
from the preset should create their own moduleNameMapper
ts-jest
util https://kulshekhar.github.io/ts-jest/docs/getting-started/paths-mapping
skipLibCheck
is not defined in tsconfig, jest-preset-angular
will set it to true
. If one wants to have it as false
, one can set explicitly in tsconfig.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',
},
}
Published by github-actions[bot] over 3 years ago
Published by github-actions[bot] over 3 years ago
Published by github-actions[bot] over 3 years ago
Published by github-actions[bot] over 3 years ago
Published by github-actions[bot] over 3 years ago