Add: Jasmine test

This commit is contained in:
surunzi
2016-08-16 18:56:34 +08:00
parent 89f63948d0
commit ec5fe27797
12 changed files with 382 additions and 35 deletions

28
test/boot.js Normal file
View File

@@ -0,0 +1,28 @@
function boot(name)
{
// Need a little delay to make sure width and height of webpack dev server iframe are initialized.
setTimeout(function ()
{
eruda.init({tool: name});
eruda.show().get().config.set('displaySize', '50%');
loadJs('lib/boot', function ()
{
loadJs('lib/jasmine-jquery', function ()
{
// This is needed to trigger jasmine initialization.
loadJs(name, function ()
{
window.onload();
});
});
});
}, 500);
}
function loadJs(src, cb)
{
var script = document.createElement('script');
script.src = src + '.js';
script.onload = cb;
document.body.appendChild(script);
}