Created
July 16, 2016 08:31
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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