Anything above Node 8
There are many ways to run tests. Here is a list
Command | Headless | Starts server | Code under test |
---|---|---|---|
npm test |
✔️ | ✔️ | Source files |
npm run test:source |
✔️ | ✔️ | Source files |
npm run test:bundle |
✔️ | ✔️ | Distribution bundle |
npm run run:cypress |
✔️ | ❌ | Source files |
npm run run:cypress:source |
✔️ | ❌ | Source files |
npm run run:cypress:bundle |
✔️ | ❌ | Distribution bundle |
npm start |
❌ | ✔️ | Source files |
npm run start:source |
❌ | ✔️ | Source files |
npm run start:bundle |
❌ | ✔️ | Distribution bundle |
npm run start:cypress |
❌ | ❌ | Source files |
npm run start:cypress:source |
❌ | ❌ | Source files |
npm run start:cypress:bundle |
❌ | ❌ | Distribution bundle |
For commands that don't start their own server you'll need to run npm run start:server
in a second
command line.
npm publish
will run tests that have to pass before allowing you to publish.