briebug / jest-schematic

Angular schematic for adding Jest and the required files to an Angular CLI project
MIT License
322 stars 38 forks source link

Fix preset import path for jest-preset-angular in setup-jest.ts #82

Closed inorganik closed 2 years ago

inorganik commented 2 years ago

Several versions back, jest-preset-angular changed the location of the preset used in setup-jest.ts

Before import 'jest-preset-angular';

Current import 'jest-preset-angular/setup-jest';

The schematic needs to the import path updated to the current location, otherwise you get errors like the following because zone isn't included:

"Zone is needed for the waitForAsync() test helper but could not be found..."

To Reproduce

  1. Run the schematic on a project.

Expected behavior Should import from the proper location.

Desktop (please complete the following information):