My directory follows this structure:
src
/test
- file-test.js
- file.js
My Mocha script uses
mocha -R spec --recursive ./**/*-test.js
Which leads to the fantastical error of Error: Cannot find module 'tap'
.
But peculiarly the following two options work
mocha -R spec --recursive ./src/**/*-test.js
- Renaming
file-test.js
tofile.test.js
and usingmocha -R spec --recursive ./**/*.test.js
But I have no idea why those two options work, and my original plan did not.