jest-preset-angular

Jest configuration preset for Angular projects.

MIT License

Downloads
3.6M
Stars
867
Committers
73

Bot releases are visible (Hide)

jest-preset-angular - v11.0.0-rc.3

Published by github-actions[bot] almost 3 years ago

jest-preset-angular - v11.0.0-rc.2

Published by github-actions[bot] almost 3 years ago

jest-preset-angular - v11.0.0-rc.1

Published by github-actions[bot] almost 3 years ago

jest-preset-angular - v11.0.0-rc.0

Published by github-actions[bot] almost 3 years ago

jest-preset-angular - v10.1.0

Published by github-actions[bot] almost 3 years ago

jest-preset-angular - v10.0.1

Published by github-actions[bot] about 3 years ago

jest-preset-angular - v10.0.0

Published by ahnpnl about 3 years ago

jest-preset-angular - v9.0.7

Published by github-actions[bot] about 3 years ago

jest-preset-angular - v9.0.6

Published by github-actions[bot] about 3 years ago

jest-preset-angular - v9.0.5

Published by github-actions[bot] over 3 years ago

jest-preset-angular - v9.0.4

Published by github-actions[bot] over 3 years ago

jest-preset-angular - v9.0.3

Published by github-actions[bot] over 3 years ago

jest-preset-angular - v9.0.2

Published by github-actions[bot] over 3 years ago

jest-preset-angular - v9.0.1

Published by github-actions[bot] over 3 years ago

jest-preset-angular - v9.0.0

Published by github-actions[bot] over 3 years ago

Bug Fixes

Features

Performance Improvements

  • compiler: reuse cacheFS from jest to reduce file system reading (#679) (f5d9d4b)
  • config: set skipLibCheck: true if not defined in tsconfig (#678) (0df3ce1)

BREAKING CHANGES

  • Drop support for Angular < 8.0, see https://angular.io/guide/releases#support-policy-and-schedule.
  • Drop support for Node.js version 10 since it becomes EOL on 2021-04-30. Required Node version now is >=12.13.0.
  • Require Jest 27.
  • Users who are using import 'jest-preset-angular' should change to import 'jest-preset-angular/setup-jest'
  • transformers: The AST transformers InlineFilesTransformer and StripStylesTransformer are REMOVED and
    default jest-preset-angular uses AST transformers from @angular/compiler-cli and @ngtools/webpack.
    One should remove the old transformers from the jest config.
  • compiler: 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',
    },
}
  • serializers:: snapshot serializer paths have been changed:
    • '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.
  • When generating a new project from Angular CLI, by default the tsconfig.json doesn't contain any path mappings
    hence removing moduleNameMapper from preset will make sure that the preset works in pair with tsconfig.json.
    Ones who are relying on the value of moduleNameMapper from the preset should create their own moduleNameMapper
    config manually or via ts-jest util https://kulshekhar.github.io/ts-jest/docs/getting-started/paths-mapping
  • By default, if 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.
  • compiler: 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 - v9.0.0-next.14

Published by github-actions[bot] over 3 years ago

jest-preset-angular - v9.0.0-next.13

Published by github-actions[bot] over 3 years ago

jest-preset-angular - v9.0.0-next.12

Published by github-actions[bot] over 3 years ago

jest-preset-angular - v9.0.0-next.11

Published by github-actions[bot] over 3 years ago

jest-preset-angular - v9.0.0-next.10

Published by github-actions[bot] over 3 years ago