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

Integration tests are failing randomly #6

Open
jakimcho opened this issue Jan 3, 2019 · 2 comments
Open

Integration tests are failing randomly #6

jakimcho opened this issue Jan 3, 2019 · 2 comments

Comments

@jakimcho
Copy link

jakimcho commented Jan 3, 2019

Summary

Integration tests fail in a random manner.

Steps

  1. Run npm test

Result:

Some integration tests are failing with:

...................

auth middleware
    ✕ should return 401 if no token is provided (342ms)
    ✕ should return 400 if token is invalid (132ms)
    ✓ should return 200 if token is valid (122ms)

  ● auth middleware › should return 401 if no token is provided

    listen EADDRINUSE :::3900

      12 | 
      13 | const port = process.env.PORT || config.get("port");
    > 14 | const server = app.listen(port, () =>
      15 |   winston.info(`Listening on port ${port}...`)
      16 | );

...............

Expected Result

All tests (unit and integration) should pass

Probable reason

Race condition. The server has not been stopped on time when the next test cases initiates.

@yardenshoham
Copy link

yardenshoham commented Aug 21, 2019

I have the same issue. I believe more people are having this problem at #12.

Edit: It seems a solution was provided in #1. Here's the comment with the solution.

@ybakhshi
Copy link

ybakhshi commented Feb 5, 2020

[email protected] test C:\projects\vidly-api-node
jest --watchAll --verbose --runInBand

Error: Cannot find module 'walker'
Require stack:

  • C:\projects\vidly-api-node\node_modules\sane\src\common.js
  • C:\projects\vidly-api-node\node_modules\sane\src\node_watcher.js
  • C:\projects\vidly-api-node\node_modules\sane\index.js
  • C:\projects\vidly-api-node\node_modules\jest\node_modules\jest-cli\node_modules\jest-haste-map\build\index.js
  • C:\projects\vidly-api-node\node_modules\jest\node_modules\jest-cli\node_modules\jest-runtime\build\index.js
  • C:\projects\vidly-api-node\node_modules\jest\node_modules\jest-cli\build\cli\index.js
  • C:\projects\vidly-api-node\node_modules\jest\node_modules\jest-cli\bin\jest.js
  • C:\projects\vidly-api-node\node_modules\jest\bin\jest.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
    at Function.Module._load (internal/modules/cjs/loader.js:862:27)
    at Module.require (internal/modules/cjs/loader.js:1040:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object. (C:\projects\vidly-api-node\node_modules\sane\src\common.js:3:14)
    at Module._compile (internal/modules/cjs/loader.js:1151:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1040:19)
    npm ERR! Test failed. See above for more details.

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

3 participants