Skip to content

Instantly share code, notes, and snippets.

@abhirathore2006
Created July 16, 2016 08:31
Show Gist options
  • Save abhirathore2006/0188dced9e42174addedc2c229b0825d to your computer and use it in GitHub Desktop.
Save abhirathore2006/0188dced9e42174addedc2c229b0825d to your computer and use it in GitHub Desktop.
window not defined, $ not defined , document not defined fixes all of them on server side
require("jsdom").env("", function(err, window) {
if (err) {
console.error(err);
return;
}
global.document =window.document;
global.window=window;
global.$ = require("jquery")(window);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment