Last active
June 12, 2016 09:33
-
-
Save andrei-cacio/a1c23d3cf15e8c4ddeeb1f80065169dd to your computer and use it in GitHub Desktop.
jQuery getter function
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
let nodeJquery = null; | |
export function getJquery(spy = false) { | |
if (!nodeJquery) { | |
const sinon = require('sinon'); | |
const fakeDOM = require('jsdom').jsdom(); | |
nodeJquery = require('jquery')(fakeDOM.defaultView); | |
} | |
return nodeJquery; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment