A demo of using a bash script to run tape
tests in sequence.
- Each test script can be run in isolation, and passes:
node one-test.js
node two-test.js
- When running all tests via
tape
globbing, second test fails:
npm run tape '*-test.js'
# or
npm run bad-test
- Using bash, all tests run and pass:
bash run-tests.sh
# or
npm test
- Code being tested calls a
global
function repeatedly, and does not stop. tape
allows for running multiple tests via globbing, e.g.:tape '*-test.js'
. However, to accomplish thistape
willrequire
each script into the same environment, meaning they will shareglobal
.
- A bash script that runs each test independently, in sequence.