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
This may not be a bug report as such but an interesting issue.
The changes made in #65 may introduce a new issue for users using jQuery or other libraries.
At Lonely Planet we use the nice Jasmine jQuery utility to load fixtures, spy on events etc.
Jasmine jQuery is not AMD compatible so we simply load it in as a helper script. This is also requires that we load jQuery onto the page first, done with the vendor option for the main Jasmine Grunt task.
Because RequireJS is now being loaded after the vendor and helper scripts jQuery is not registering itself as an AMD module. This means our AMD specs are loading in a new version of jQuery which introduces some interesting bugs.
As the two versions of jQuery are not the same internal data set by one instance is not shared with the other. For instance, event handlers are stored internally against an element. Jasmine jQuery features a useful spyOnEvent function which binds a simple handler, however because this is bound by the first version of jQuery loaded onto the page it is not triggered when the specs are run because they're dispatching events using a different jQuery instance.
I'm not sure what the best solution to this problem is but it's quite insidious to debug!
The text was updated successfully, but these errors were encountered:
This may not be a bug report as such but an interesting issue.
The changes made in #65 may introduce a new issue for users using jQuery or other libraries.
At Lonely Planet we use the nice Jasmine jQuery utility to load fixtures, spy on events etc.
Jasmine jQuery is not AMD compatible so we simply load it in as a helper script. This is also requires that we load jQuery onto the page first, done with the
vendor
option for the main Jasmine Grunt task.Because RequireJS is now being loaded after the vendor and helper scripts jQuery is not registering itself as an AMD module. This means our AMD specs are loading in a new version of jQuery which introduces some interesting bugs.
As the two versions of jQuery are not the same internal data set by one instance is not shared with the other. For instance, event handlers are stored internally against an element. Jasmine jQuery features a useful
spyOnEvent
function which binds a simple handler, however because this is bound by the first version of jQuery loaded onto the page it is not triggered when the specs are run because they're dispatching events using a different jQuery instance.I'm not sure what the best solution to this problem is but it's quite insidious to debug!
The text was updated successfully, but these errors were encountered: