forked from bretcope/neo4j-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
29 lines (23 loc) · 813 Bytes
/
test.js
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
// this file is simply to allow for debugging the unit tests... hence the 1 hour timeout
// for normal testing, just run 'mocha' in this directory.
var Mocha = require('mocha'),
fs = require('fs'),
path = require('path');
// First, you need to instantiate a Mocha instance.
var mocha = new Mocha({ reporter: 'Spec', timeout: 3600000 });
// 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)
);
});
// Now, you can run the tests.
mocha.run(function(failures){
process.exit(failures);
});