test command is a command that runs whenever you call npm test .
This is important when integrating with continuous integration / continuous deployment tools (such as jenkins , codeship , teamcity ).
Example:
- say that you are deploying a project for AWS or some other cloud hosting provider,
- you can configure your infrastructure to run npm test automatically.
- If there are problems during these tests, your ci / cd will automatically roll back to deployment.
Test execution
You can use karma, jest or selenium / nightmare / phantomjs or any other scripting script library / environment that allows you to write and run tests, and then install the required command in the scripts.test file and finally run it from npm test .
Denis tsoi
source share