Created
December 21, 2015 17:05
-
-
Save brianswisher/ab646dc47b0e9a9df4b9 to your computer and use it in GitHub Desktop.
Testing Teamplate
This file contains hidden or 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
((libs) => { | |
var promises = []; | |
libs.forEach((src) => { | |
promises.push(new Promise(resolve => { | |
if (!document.querySelector(`[src="${src}"]`)) { | |
const script = document.createElement("script"); | |
script.src = src; | |
script.async = false; | |
script.onload = () => { | |
resolve(); | |
}; | |
document.head.appendChild(script); | |
} else { | |
resolve(); | |
} | |
})); | |
}); | |
return Promise.all(promises) | |
.then(() => { | |
expect(1).toEqual(1); | |
console.log("All tests passed."); | |
}); | |
})([ | |
"https://wzrd.in/standalone/expect@latest" | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment