iwmlib/pixi/test/testsuite.js
2019-03-21 09:57:27 +01:00

53 lines
841 B
JavaScript

/* globals mocha, chai, Bootstrap */
/* eslint no-console: ["error", { allow: ["log", "info", "error"] }] */
/**
* Mocha setup
*/
mocha.setup('bdd')
/**
* Chai setup
*/
const assert = chai.assert
/**
* List of tests
*/
let tests = [
'../test/tests/zoomInZoomOut.js'
]
/**
*
*/
class UITestSuite {
async run(type = 'all') {
window.testType = type
this.reset()
for (let test of tests) {
await this.loadTest(test)
}
mocha.run()
}
reset() {
mocha.suite.suites = []
document.getElementById('mocha').innerHTML = ''
}
loadTest(url) {
return new Promise(resolve => {
Bootstrap.import(`${url}?_=${Date.now()}`, () => {
resolve()
})
})
}
}
window.uiTestSuite = new UITestSuite()