How do I write a Jest test case in TypeScript to check if any required dependency is missing from package.json

Viewed 15

I have a Node project where I have all the required dependencies listed in package.json. I use Docker to deploy the project and Jenkins for continuous deployment.

I want to write a Jest test case such that if any required dependency is removed from package.json (accidentally), I should be able to catch the error during Jenkins build.

It is not necessarily to be a test case, it can be anything, with that I should be able to catch the error during Jenkins build, and the build should fail if any dependency is missing.

0 Answers
Related