Closed prh7 closed 8 years ago
'config'
is wrong. If you use correct paths ('./config.js'
) you can just as easily proxyquire non-function values as you can methods.
@bendrucker Ok I have used the correct path. How do you stub object's proprerty? The way I have done gives me null or undefined when i console.log(config.switch) inside test case.
Please post a full project I can run, hard to guess at what's wrong otherwise
Though this might not be an issue but you can take it simply as question. The question is: I have a file
config.js
with the below code in it:I have another file
bus.js
with the below code in it:Now, I want to unit test the file
bus.js
Any sort of suggestion or guidance will be highly appreciated.