Skip to content

Instantly share code, notes, and snippets.

View senica's full-sized avatar

Senica Gonzalez senica

View GitHub Profile
@senica
senica / jsdom-load.js
Created June 30, 2017 17:38
JSDOM simplification for loading scripts
/**
* If you are use to pre-version 10 jsdom, post 10 is an absolute nuisance for loading scripts...especially when you just
* want to test some code.
* This just creates a nice little wrapper to simplify everythign.
**/
const __jsdom = require("jsdom");
const { JSDOM } = __jsdom;
global.jsdom = function(html = '', scripts = []){
return new Promise((resolve, reject)=>{