1 import * as path from 'path';
2 import Mocha from 'mocha';
3 import glob from 'glob';
5 export function run(): Promise<void> {
6 // Create the mocha test
7 const mocha = new Mocha({
12 const testsRoot = __dirname;
14 return new Promise((resolve, reject) => {
15 glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
20 // Add files to the test suite
21 files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
25 mocha.timeout(100000);
26 mocha.run(failures => {
28 reject(new Error(`${failures} tests failed.`));