You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run "npm test" --> mocha './test/**/*.spec.js', it runs perfectly.
But when I run it with mocha sidebar it doesn't pay attention to my "setup.spec.js"
To avoid this behavior with mocha-sidebar I have to add at the beginning of each test file this: require("../setup.spec");
I will start the migration to jest because also with Sinon + Decache I am facing issues with my app.js file when I tried to mock a Middleware (Google Captcha). It works perfectly, except for the Sequelize connection that remains OPEN because of the "decache". That provokes the test run never quits.
Tried for a bit to figure this out; --require is loaded before mocha is initialized so if you have a global hook in there it will run but won't work. I ended up just doing a replace-all for import 'mocha'; -> import 'mocha';\nimport 'tests/globals'; and that worked pretty well.
When I run "npm test" --> mocha './test/**/*.spec.js', it runs perfectly.
But when I run it with mocha sidebar it doesn't pay attention to my "setup.spec.js"
To avoid this behavior with mocha-sidebar I have to add at the beginning of each test file this: require("../setup.spec");
I have this error:
TypeError: Cannot read property 'eventually' of undefined
If I add that file as required I have the message: "before is not defined"
Does anyone know how can I run setup.spec.js before everything?
require("./setup.spec"); in each test file is not an option.
The text was updated successfully, but these errors were encountered: