Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm test generates error during execution #4

Open
VladyslavKurmaz opened this issue Jun 20, 2020 · 2 comments
Open

npm test generates error during execution #4

VladyslavKurmaz opened this issue Jun 20, 2020 · 2 comments

Comments

@VladyslavKurmaz
Copy link
Contributor

Observed behavior

'npm test' run doesn't finish successfully

Expected behavior

No errors during tests executions

Steps to reproduce

  • checkout repository
  • run cp .env.defaults .env
  • run npm i
  • run npm test

A couple of output lines from the log's tail

ERROR: Coverage for lines (52.52%) does not meet global threshold (80%)
ERROR: Coverage for functions (30.63%) does not meet global threshold (80%)
ERROR: Coverage for statements (52.52%) does not meet global threshold (80%)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test:coverage: `c8 npm run test:ava`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test:coverage 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!     /root/.npm/_logs/2020-06-20T21_03_37_542Z-debug.log
npm ERR! Test failed.  See above for more details.
@vira-khdr
Copy link
Collaborator

Hi! Seems like, you haven't started docker-compose and/or haven't run migrations for test database.

Here is checklist with steps: https://github.com/WebbyLab/webbylab-starter-app-for-nodejs#run-development-version

@VladyslavKurmaz
Copy link
Contributor Author

Ok, thanks for the response, I will check it.
I'm working on Jenkins integration and need to have clear understanding how build process is configured to implement correct PR/PUSH builds.
I will create separated PR with clarifications
...
Here is my 5 cents that can be considered to review as an improvement.
In my simple world, unit tests should be executed in isolated environment, when all other related components are mocked and have predefined behavior. As far as I understood, current implementation uses "real db", so it looks like integration tests when two or more "real" components are involved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants