mocha Error: No test files found: “test/” npm ERR! Test failed

seeing your project structure, seems that you have one test.js so mocha should target this file.

"scripts": {
  "test": "mocha test.js --reporter mocha-junit-reporter --timeout 60000 --exit",
},

If you want to add more test files, it is better to put them inside test directory e.g. /test and must change the target to test files inside the directory.

"scripts": {
  "test": "mocha 'test/**/*.js' --recursive --reporter mocha-junit-reporter --timeout 60000 --exit",
},

Hope it helps

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)