Closed bonidjukic closed 7 years ago
The way you are doing it there is correct. Docs were out of date. Would you mind making a PR to update them?
I'd do it myself, but I'd like you to be credited with the contribution
@DorianGray, of course, thanks for that! I've created a PR.
I ran into issues while trying to test private functions as per the documentation:
Requiring
mymodule
at the top level executes the code from the module at that instance, so when later we define_G._TEST = true
within thesetup
function,mymodule
has already been required and the global_TEST
is not set.I don't see any other way than to declare the
mymodule
at the top, and then require it within thesetup
function once the global_TEST
has been set: