Estou lendo o livro do waldemar neto sobre nodejs, e tem uma parte que não consigo sair, fiz uma configuração para rodar um teste na minha aplicação, baixei os modules que o livro pediu: mocha, chai e p supertest e no meu package.json coloquei o seguinte script:
"test:integration": "NODE_ENV=test mocha --opts test/integration/mocha.opts test/integration/**/*_spec.js"
so que quando eu rodo com o npm run dev tes:integration como o livro mandou me aparece esse erro:
> api-loja-virtual@1.0.0 test:integration /home/ed/projeto/api-loja-virtual
> NODE_ENV=test mocha --opts test/integration/mocha.opts test/integration/**/*_spec.js
/home/ed/projeto/api-loja-virtual/node_modules/mocha/lib/cli/options.js:209
throw new Error(`Unable to read ${filepath}: ${err}`);
^
Error: Unable to read test/integration/mocha.opts: Error: ENOENT: no such file or directory, open 'test/integration/mocha.opts'
at loadMochaOpts (/home/ed/projeto/api-loja-virtual/node_modules/mocha/lib/cli/options.js:209:13)
at loadOptions (/home/ed/projeto/api-loja-virtual/node_modules/mocha/lib/cli/options.js:310:22)
at Object.<anonymous> (/home/ed/projeto/api-loja-virtual/node_modules/mocha/bin/mocha:29:14)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)
at internal/main/run_main_module.js:17:11
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! api-loja-virtual@1.0.0 test:integration: `NODE_ENV=test mocha --opts test/integration/mocha.opts test/integration/**/*_spec.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the api-loja-virtual@1.0.0 test:integration script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ed/.npm/_logs/2019-07-18T23_16_05_549Z-debug.log
oque pode ser ??
segue o github para baixar o code: https://github.com/MAdMAX-io/API-loja-virtual