Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-preset-angular

Package Overview
Dependencies
Maintainers
3
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-preset-angular - npm Package Versions

1
15

9.0.5

Diff

Changelog

Source

9.0.5 (2021-07-22)

Features

  • remove more trailing whitespaces for component fixture snapshot (#961) (e51cf6f), closes #287

Code Refactoring

  • remove webpack and @angular-devkit/build-angular from peer dependencies and optional dependencies (#973) (ce7fc60)
anhpnnd
published 9.0.4 •

Changelog

Source

9.0.4 (2021-06-15)

Bug Fixes

  • widen range for optional webpack dependency (#955) (b3e8047)
anhpnnd
published 9.0.3 •

Changelog

Source

9.0.3 (2021-06-08)

Bug Fixes

  • add missing @angular/platform-browser-dynamic to peer dep (c1729e4)
anhpnnd
published 9.0.2 •

Changelog

Source

9.0.2 (2021-06-06)

Bug Fixes

anhpnnd
published 9.0.1 •

Changelog

Source

9.0.1 (2021-05-28)

Bug Fixes

anhpnnd
published 9.0.0 •

Changelog

Source

9.0.0 (2021-05-27)

Bug Fixes

Features

  • support Jest 27 (#926) (1c761f8)
  • config: load zone ESM when running jest in ESM mode (#892) (e03ec19), closes #751
  • add exports field to package.json, see https://nodejs.org/api/packages.html#packages_package_entry_points
  • presets: add type definition for presets entry point (#801) (e4ff0c0)
  • compiler: support ESM (#721) (a2166f8)
  • presets: add ESM preset (#723) (b0073b0)
  • compiler: use replace-resources AST transformer from Angular (#708) (1b20c19)
  • compiler: use downlevel-ctor AST transformer from Angular (#730) (1f964c3)

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 < 9.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.

If you wish to reuse the old configuration of moduleNameMapper, you can put this into your Jest config

moduleNameMapper: {
  '^src/(.*)$': '<rootDir>/src/$1',
  '^app/(.*)$': '<rootDir>/src/app/$1',
  '^assets/(.*)$': '<rootDir>/src/assets/$1',
  '^environments/(.*)$': '<rootDir>/src/environments/$1',
}
  • 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',
    },
}
anhpnnd
published 9.0.0-next.14 •

Changelog

Source

9.0.0-next.14 (2021-05-05)

Bug Fixes

BREAKING CHANGES

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

anhpnnd
published 9.0.0-next.13 •

Changelog

Source

9.0.0-next.13 (2021-04-18)

BREAKING CHANGES

  • Drop support for Node.js version 10 since it becomes EOL on 2021-04-30. To support Angular 12, Node.js 12.13+ or 14.15+ is required.
anhpnnd
published 9.0.0-next.12 •

Changelog

Source

9.0.0-next.12 (2021-03-31)

Bug Fixes

anhpnnd
published 9.0.0-next.11 •

Changelog

Source

9.0.0-next.11 (2021-03-21)

Features

  • config: load zone ESM when running jest in ESM mode (#892) (e03ec19), closes #751

BREAKING CHANGES

  • add exports field to package.json, see https://nodejs.org/api/packages.html#packages_package_entry_points
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc