Further experimentation

This commit is contained in:
Pieter Vander Vennet 2021-12-30 20:41:45 +01:00
parent 9c6822a1ac
commit bfb16874b1
7 changed files with 284 additions and 87 deletions

View file

@ -56,16 +56,18 @@ export default class T {
* Returns an empty list if successful
* @constructor
*/
public Run(): { testsuite: string, name: string, msg: string } [] {
public async Run(): Promise<{ testsuite: string, name: string, msg: string } []> {
const failures: { testsuite: string, name: string, msg: string } [] = []
for (const [name, test] of this._tests) {
try {
const r = test()
if (r instanceof Promise) {
r.catch(e => {
try {
await r
} catch (e) {
console.log("ASYNC ERROR: ", e, e.stack)
failures.push({testsuite: this.name, name: name, msg: "" + e});
});
}
}
} catch (e) {