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
Now, for my example, think of thingB as a private module method. I can avoid the issue by removing it from the exported object and just have the method local to the module. This makes it truly private and resolves my problem, but now I don't have a good way to test the private methods aside from implicit testing through public methods that call it.
I am testing a module I have written that is expected in node as a plain old object, but some methods call other methods in the module.
For example, I have code similar to this in my module:
MyModule.js
My test looks like:
MyModule.spec.js
Now, for my example, think of
thingB
as a private module method. I can avoid the issue by removing it from the exported object and just have the method local to the module. This makes it truly private and resolves my problem, but now I don't have a good way to test the private methods aside from implicit testing through public methods that call it.Another option is pre-defining the module:
I'm not opposed to this, since it's technically correct, but would it be possible to be able to do something like:
Using
apply
andcall
already accept a bounding variable, it just needs to be set.The text was updated successfully, but these errors were encountered: