tkottke90 / bin-inventory

Web application for inventory management
0 stars 0 forks source link

Fix automated testing in API #7

Open tkottke90 opened 4 years ago

tkottke90 commented 4 years ago

The automated testing system fails when run within the repository:

npm run mocha

> bin-inventory-api@0.1.0 mocha /home/altotom90/Projects/bin-inventory/src/api
> NODE_ENV=testing PORT=9999 HIDE_ENV=true mocha -r ts-node/register --exit test/**/*.test.ts

npm ERR! code ELIFECYCLE
npm ERR! errno 144
npm ERR! bin-inventory-api@0.1.0 mocha: `NODE_ENV=testing PORT=9999 HIDE_ENV=true mocha -r ts-node/register --exit test/**/*.test.ts`
npm ERR! Exit status 144
npm ERR! 
npm ERR! Failed at the bin-inventory-api@0.1.0 mocha 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/altotom90/.npm/_logs/2020-09-04T02_53_30_143Z-debug.log

Targeting specific files has mixed results:

NODE_ENV=testing PORT=9999 HIDE_ENV=true npx mocha -r ts-node/register --exit test/app.test.ts 

<no output>
NODE_ENV=testing PORT=9999 HIDE_ENV=true npx mocha -r ts-node/register --exit test/hooks/hash-password.test.ts 

  [Hook] 'hash-password'
    - should modify the 'context.data.password'

  0 passing (3ms)
  1 pending