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
{{ message }}
This repository has been archived by the owner on May 29, 2024. It is now read-only.
To use f-mocha you have to import the module and explicitly call setup and this has to be done inside of at least one of the test cases. If you look at how co-mocha achieves the same thing, they do it in a way where no explicit setup is required and it has the benefit that this can be done before mocha is initialized.
We run our tests and have a --require in our mocha.opts file that loads a test initialization file anytime a test is executed without having to repeat that initialization in every test. This is where we put the initialization call to co-mocha. If I put your setup call for f-mocha in that code it fails because mocha hasn't initialized yet and the functions you are looking for do not yet exist in the global namespace. The co-mocha library seems to have found a way around that (https://github.com/blakeembrey/co-mocha/blob/master/lib/co-mocha.js#L53).
An alternative to consider.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
To use
f-mocha
you have to import the module and explicitly call setup and this has to be done inside of at least one of the test cases. If you look at howco-mocha
achieves the same thing, they do it in a way where no explicitsetup
is required and it has the benefit that this can be done before mocha is initialized.We run our tests and have a
--require
in ourmocha.opts
file that loads a test initialization file anytime a test is executed without having to repeat that initialization in every test. This is where we put the initialization call toco-mocha
. If I put your setup call forf-mocha
in that code it fails because mocha hasn't initialized yet and the functions you are looking for do not yet exist in the global namespace. Theco-mocha
library seems to have found a way around that (https://github.com/blakeembrey/co-mocha/blob/master/lib/co-mocha.js#L53).An alternative to consider.
The text was updated successfully, but these errors were encountered: