-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunTestTime.js
More file actions
40 lines (29 loc) · 884 Bytes
/
runTestTime.js
File metadata and controls
40 lines (29 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const Mocha = require('mocha'),
fs = require('fs'),
path = require('path');
const runTestOnce = () => {
// Instantiate a Mocha instance.
var mocha = new Mocha({
reporter: 'list'
});
var testDir = './test/tests/'
// Add each .js file to the mocha instance
fs.readdirSync(testDir).filter(function (file) {
// Only keep the .js files
return file === 'evalWaitTest.js';
}).forEach(function (file) {
mocha.addFile(
path.join(testDir, file)
);
});
// Run the tests.
mocha.run(function (failures) {
process.exitCode = failures ? 1 : 0; // exit with non-zero status if there were failures
// process.send('hello')
});
// mocha.run()
// .on('test end', (test) => {
// console.log('Test done: ' + test.title);
// })
}
runTestOnce()