Restructured library.
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
/* 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()
|
||||
Reference in New Issue
Block a user