forked from jpush/jpush-api-nodejs-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
33 lines (28 loc) · 834 Bytes
/
test.js
File metadata and controls
33 lines (28 loc) · 834 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
var Mocha = require('mocha'),
fs = require('fs'),
path = require('path');
// First, you need to instantiate a Mocha instance.
var mocha = new Mocha({
timeout:50000,
reporter: 'spec'
});
// Then, you need to use the method "addFile" on the mocha
// object for each file.
//// Here is an example:
//fs.readdirSync('./test').filter(function(file){
// // Only keep the .js files
// return file.substr(-3) === '.js';
//
//}).forEach(function(file){
// // Use the method "addFile" to add the file to mocha
// mocha.addFile(
// path.join('./test', file)
// );
// });
mocha.addFile('./test/DeviceTest.js');
// Now, you can run the tests.
mocha.run(function(failures){
process.on('exit', function () {
process.exit(failures);
});
});