Skip to content

Instantly share code, notes, and snippets.

@nucleartide
Created June 18, 2015 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nucleartide/37caa96f15ceb0943385 to your computer and use it in GitHub Desktop.
Save nucleartide/37caa96f15ceb0943385 to your computer and use it in GitHub Desktop.
Strange bug?
{
"devDependencies": {
"jsdom": "^2.0.0"
},
"dependencies": {
"backbone": "^1.1.2",
"jquery": "^2.1.4"
}
}
// Requiring Backbone 1.2.1 here causes $.Deferred to be undefined.
require('backbone');
if (!global.document || !global.window) {
var jsdom = require('jsdom').jsdom;
global.document = jsdom('<html><head><script></script></head><body></body></html>', null, {
FetchExternalResources : ['script'],
ProcessExternalResources : ['script'],
MutationEvents : '2.0',
QuerySelector : false
});
global.window = document.parentWindow;
global.navigator = global.window.navigator;
global.location = global.window.location;
}
var $ = require('jquery');
console.log('This is undefined:');
console.log($.Deferred);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment