Skip to content

Commit 9803ae4

Browse files
author
Fred Wu
committed
uncomment index.ts
1 parent fa33b62 commit 9803ae4

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

src/test/suite/index.ts

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
///* eslint-disable @typescript-eslint/ban-ts-comment */
2-
///* eslint-disable @typescript-eslint/no-unsafe-member-access */
3-
///* eslint-disable @typescript-eslint/no-unsafe-call */
1+
/* eslint-disable @typescript-eslint/ban-ts-comment */
2+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
3+
/* eslint-disable @typescript-eslint/no-unsafe-call */
44

5-
//import * as path from 'path';
6-
//import * as Mocha from 'mocha';
7-
//import { glob } from 'glob';
5+
import * as path from 'path';
6+
import * as Mocha from 'mocha';
7+
import { glob } from 'glob';
88

9-
//export function run(): Promise<void> {
10-
// // Create the mocha test
11-
// const mocha = new Mocha({
12-
// ui: 'tdd',
13-
// color: true
14-
// });
9+
export function run(): Promise<void> {
10+
// Create the mocha test
11+
const mocha = new Mocha({
12+
ui: 'tdd',
13+
color: true
14+
});
1515

16-
// const testsRoot = path.resolve(__dirname, '..');
16+
const testsRoot = path.resolve(__dirname, '..');
1717

18-
// return new Promise((c, e) => {
19-
// glob('**/**.test.js', { cwd: testsRoot })
20-
// .then(files => {
21-
// // Add files to the test suite
22-
// files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
18+
return new Promise((c, e) => {
19+
glob('**/**.test.js', { cwd: testsRoot })
20+
.then(files => {
21+
// Add files to the test suite
22+
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
2323

24-
// try {
25-
// // Run the mocha test
26-
// mocha.run(failures => {
27-
// if (failures > 0) {
28-
// e(new Error(`${failures} tests failed.`));
29-
// } else {
30-
// c();
31-
// }
32-
// });
33-
// } catch (err) {
34-
// e(err);
35-
// }
36-
// })
37-
// .catch(err => {
38-
// return e(err);
39-
// });
40-
// });
41-
//}
24+
try {
25+
// Run the mocha test
26+
mocha.run(failures => {
27+
if (failures > 0) {
28+
e(new Error(`${failures} tests failed.`));
29+
} else {
30+
c();
31+
}
32+
});
33+
} catch (err) {
34+
e(err);
35+
}
36+
})
37+
.catch(err => {
38+
return e(err);
39+
});
40+
});
41+
}

0 commit comments

Comments
 (0)