-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathtest.js
41 lines (34 loc) · 788 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
30
31
32
33
34
35
36
37
38
39
40
'use strict';
/**
* Run package tests.
* (C) 2014 Alex Fernández.
*/
// requires
var testing = require('testing');
var Log = require('log');
// globals
var log = new Log('info');
/**
* Run all module tests.
*/
exports.test = function(callback)
{
log.debug('Running tests');
var tests = {};
var libs = ['estimation', 'badges', 'cache', 'cached-request', 'utils'];
var factors = ['issues', 'versions', 'downloads'];
libs.forEach(function(lib)
{
tests[lib] = require('./lib/' + lib + '.js').test;
});
factors.forEach(function(factor)
{
tests[factor] = require('./lib/factors/' + factor + '.js').test;
});
testing.run(tests, 4200, callback);
};
// run tests if invoked directly
if (__filename == process.argv[1])
{
exports.test(testing.show);
}