-
Notifications
You must be signed in to change notification settings - Fork 60
mockery and Jasmine #26
Comments
I've never used Jasmine so I'll have to look into how it works in order to figure out what is breaking. Do you have a simple repro case that I can run to test with? I can add that to our new tests to make sure that it's executed when we build. |
I believe the issue is not Jasmine, but RequireJS. Here is an example that includes the change I made in mockery.js at the beginning of the file: After this small change the mockery.js module loads correctly (it's not throwing). But the original modules are not replaced with mocks during testing. Here is an example: Maybe it's just something wrong with my setup. |
Its not working for me with Jasmine, hookedLoader is never called for any require following mockery.enable(). I'm not using RequireJS. I added a console.log to check if hookedLoader was called. I tested just in the REPL and it was working fine. |
I am using mockery with jasmine and it is working fine. But I using it with the wrapper posted on #28 |
when you mock paths you need use exactly the same string that was used to require, it not the path from your tests file. |
Maybe it's worth mentioning in the readme or wiki that when used with Jasmine mockery needs to be enclosed in a define () and the 'module' should be received as an argument.
The
var m = require('module')
is simply not working. Maybe it's a Jasmine issue or an undocumented expected behavior.The text was updated successfully, but these errors were encountered: