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

Testing /routes/... triggers possible Express error (ReferenceError: setImmediate is not defined) #28

Open
Meryldominguez opened this issue Jul 23, 2021 · 2 comments

Comments

@Meryldominguez
Copy link
Owner

Describe the bug
When I run jest routes/lots there are two tests that fail, giving the wrong status code.
Upon examination and debugging, It is a problem with
return next(err) (backend/middleware.js line 56)
Before that line, the error is 401 Unauthorized as expected, but after in the general error handler (backend/app.js) it is a 500 Server error ("ReferenceError: setImmediate is not defined")

Ive done a bunch of research on this and can't find anyone having this problem...

To Reproduce
Steps to reproduce the behavior:

  1. add console.log(err) to line 35 backend/app.js
  2. add console.log(err) to line 58 backend/middleware/auth.js
  3. jest routes/lots.test.js
  4. See the two errors per failed test, one a 401 Unauthorized, the second a 500 with the ReferenceError issue
@Meryldominguez
Copy link
Owner Author

Meryldominguez commented Jul 24, 2021

ALSO includes jest routes/props and jest routes/productions last two delete routes

Same problem as above, doesn't hang Jest

@Meryldominguez
Copy link
Owner Author

Meryldominguez commented Jul 24, 2021

jest routes/auth --detectOpenHandles also triggers the setImmediate is not defined but leaves jest hanging

Screen Shot 2021-07-24 at 12 36 19 PM

Screen Shot 2021-07-24 at 12 37 05 PM

@Meryldominguez Meryldominguez changed the title Testing jest routes/lots triggers Express error? Testing jest routes triggers hidden Express error (ReferenceError: setImmediate is not defined) Jul 24, 2021
@Meryldominguez Meryldominguez changed the title Testing jest routes triggers hidden Express error (ReferenceError: setImmediate is not defined) Testing /routes/... triggers possible Express error (ReferenceError: setImmediate is not defined) Jul 24, 2021
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

1 participant