Henry Tsai

2022–04–26

mocha (or mocha-ts) somehow skips some tests when using npm run test even though I specified xyz/**/*.spec.ts in package.json?
This is because the ** gets interpreted by the shell before the parameter is passed to mocha , so you have to quote it (use double quotes to be platform independent):

"test": "ts-mocha \"tests/**/*.sepc.ts\"",

--

--