-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jquery version problem with spyOnEvent #5
Comments
@stuff |
Yes I know that, but something prevents me to test events with spyOnEvent, I can't find what :( |
The problem is indeed that karma-jasmine-jquery spies on events managed by its own jQuery version |
thank you, that's what I thought maybe I should try direct jasmine-jquery. |
@rincedd: I'm also having this problem, but I'm not sure I understand what you mean by using |
@Evan-M exactly, that is what I did for the moment, I included |
@rincedd can you post the part of your |
@boldfacedesign for me it was as simple as adding |
Thanks, that's what I tried but it didn't work for me, but I've actually stopped using |
I got this error, and traced it down to mixing up the load order in the frameworks: ['jasmine', 'jasmine-jquery'], error:
Swapping the order worked: frameworks: ['jasmine-jquery', 'jasmine'], |
Hi,
I'm not very aware of the internals of jquery events, but it seems there's a problem with spyOnEvent.
I'm using a version of jQuery in my tested code loaded via karma.set, in the "files" list. I'm using Browserify too, but jquery is used via the global $ var in my modules.
I can't manage to get spyOnEvent working... Even a simple test like this is failling:
After digging a bit, I've found that I'm using a different version of jquery (more recent) and spyOnEvent is using it's own version (as specified here https://github.com/bessdsv/karma-jasmine-jquery#information) so everything looks "normal"
The fact is, if I switch from
$('#clickme')
to$j('#clickme')
, to use the "internal" karma-jasmine-jquery jquery, the test pass just fine. Of course, my code can't use that version.To be clear, it's not specifically the jquery version causing that problem; I tried to use the same exact version (2.1.1) in my own code, and it's not working. Seems that some internal data are specific to each jquery loaded or something like that.
Did some else have this problem ?
The text was updated successfully, but these errors were encountered: