Skip to content

Instantly share code, notes, and snippets.

@brianswisher
Created December 21, 2015 17:05
Show Gist options
  • Save brianswisher/ab646dc47b0e9a9df4b9 to your computer and use it in GitHub Desktop.
Save brianswisher/ab646dc47b0e9a9df4b9 to your computer and use it in GitHub Desktop.
Testing Teamplate
((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