Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Test use cases where jQuery is unavailable #62

Closed
anacronw opened this issue May 15, 2012 · 1 comment
Closed

Test use cases where jQuery is unavailable #62

anacronw opened this issue May 15, 2012 · 1 comment

Comments

@anacronw
Copy link

Currently there is no way to write specs that tests that expect jquery to be unavailable since jasmine-jquery relies on jquery. I can currently store jquery temporarily and remove/restore it during beforeEach and afterEach:

var temp;
beforeEach(function(){
  temp = $.noConflict(true)
}
afterEach(function(){
  jQuery = $ = temp;
} 

However, an error occurs with any suites that have jquery removed this way, even if the tests are no longer dependent on jquery. I imagine this is so because jasmine-jquery essentially overwrites/wraps the existing jasmine implementation to be jquery-dependent.

Can a feature be added to turn on/off jasmine-jquery during these beforeEach/afterEach cycles?

@travisjeffery
Copy link
Collaborator

This is more of a Jasmine feature than jasmine-jquery, thought if you come up with a patch I'd probably put it in.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants