briebug / jest-schematic

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

Angular 13, ng add @briebug/jest-schematic fails due to dependency conflict #134

Open poxopox opened 1 year ago

poxopox commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. npm install -g @angular/cli@13
  2. ng new -S --style=scss --strict --create-application=false -p=reprepo rep-repo
  3. ng add @briebug/jest-schematic

Expected behavior A clear and concise description of what you expected to happen.

Add the compatible @angular-builders/jest@^13.3.12 or similar version instead of the latest when using older angular versions.

Screenshots If applicable, add screenshots to help explain your problem.

image

Desktop (please complete the following information):

Additional context Maybe there's an opportunity for a feature request here? Maybe adding an optional argument to specify the version of angular-builder to install or to force the install.

Shestak2039 commented 1 year ago

Hello, I have the same issue with angular 14.2.12 image @schuchard could you help us with it?

schuchard commented 1 year ago

My initial thought is that the @angular-builders/jest version is incompatible with your version of Angular and it's manifesting through @angular-devkit/build-angular.

I've laid the groundwork for configuring this schematic's dependences with optional version numbers.

Couple options:

Franco-Oh commented 1 year ago

hello! @Shestak2039 did you find a solution? I have the same issue and the same version

rkrisztian commented 1 year ago

For Angular 14 (where the problem is also reproducible) I did it like this:

npm i -D @angular-builders/jest@^14 && npx ng add @briebug/jest-schematic@^5
kylebradshaw commented 1 year ago

I was having issues with the ng add @briebug/jest-schematic command on my angular 15.2.7 application and the equivalent worked for me, ymmv

npm i -D @angular-builders/jest@^15 && npx ng add @briebug/jest-schematic@^6