Nx: Jest config do not get update when lib or app is deleted by remove schematic

Created on 3 Dec 2020  路  5Comments  路  Source: nrwl/nx

Current Behavior

When lib or app is deleted by remove schematic the root level jest.config.js is not updated by removing the entry of deleted project. I have to manually delete the entry from this file.

yarn nx generate remove <lib-name>

Expected Behavior

jest.config.js need to automatically update by deleting the entry of deleted project

Steps to Reproduce

Step 1: Create new lib with below command

yarn nx g @nrwl/node:library <lib-name>

Step 2: Check root level jest.config.js for entry of newly created lib as result of Step 1

Step 3: Delete lib created in Step 1 by below command

yarn nx generate remove <lib-name>

Step 4: Check root level jest.config.js again the entry of newly created lib as result of Step 1 is still there

Environment

Note: nx is shown as not found below because as i did not installed nx globally

nx : Not Found @nrwl/angular : Not Found @nrwl/cli : 10.3.0 @nrwl/cypress : 10.3.0 @nrwl/eslint-plugin-nx : 10.3.0 @nrwl/express : Not Found @nrwl/jest : 10.3.0 @nrwl/linter : 10.3.0 @nrwl/nest : Not Found @nrwl/next : 10.3.0 @nrwl/node : 10.3.0 @nrwl/react : 10.3.0 @nrwl/schematics : Not Found @nrwl/tao : 10.3.0 @nrwl/web : 10.3.0 @nrwl/workspace : 10.3.0 typescript : 4.0.3

testing tools bug

All 5 comments

Good catch @suwigyarathore! I just noticed this. I will try to open a PR tonight

@mehrad-rafigh I believe it's the same issue when you run the move schematic. It doesn't cleanup the jest.config.js to reflect new changes. Everything still works fine, just need to remove the stale project reference. 馃榿

@etkachev I already guessed it. I will try to open a seperate PR for the move schematics. Alright?

@mehrad-rafigh awesome! thank you for taking care of this 馃槃

@etkachev My pleasure! I opened another issue for the move schematic and am currently adjusting the schematic. I already wrote the test for it, so I guess I will create a PR during the evening

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vimalraj-a picture vimalraj-a  路  3Comments

markphip picture markphip  路  3Comments

zpydee picture zpydee  路  3Comments

jasedwards picture jasedwards  路  3Comments

kmkatsma picture kmkatsma  路  3Comments