forked from feedhenry/fh-mbaas-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
51 lines (42 loc) · 1.43 KB
/
Gruntfile.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
41
42
43
44
45
46
47
48
49
50
51
var _ = require('underscore');
module.exports = function(grunt) {
'use strict';
function makeTestArgs(testFile) {
return ['-u exports --recursive -t 10000 ./test/setup.js', testFile].join(' ');
}
function makeUnits(testArgString) {
return [test_runner, testArgString].join(' ');
}
function makeUnitCovers(testArgString) {
return ['istanbul cover --dir cov-unit', test_runner, '--', testArgString].join(' ');
}
var tests = [ /* If updating this list of tests, also update test_win.cmd for Windows */
'./test/test_fhutils.js',
'./test/test_fhact.js',
'./test/test_fhdb.js',
'./test/test_fhforms.js',
'./test/test_fhsec.js',
'./test/test_fhsession.js',
'./test/test_fhstat.js',
'./test/test_cache.js',
'./test/test_redis.js',
'./test/test_sync.js',
'./test/test_sync_handlers.js',
'./test/test_sync_datasetmodel.js',
'./test/test_sync_utils.js',
'./test/test_fhauth.js',
'./test/test_init.js',
'./test/test_log.js',
'./test/test_fhpush.js'
];
var unit_args = _.map(tests, makeTestArgs);
var test_runner = '_mocha';
// Just set shell commands for running different types of tests
grunt.initConfig({
// These are the properties that grunt-fh-build will use
unit: _.map(unit_args, makeUnits),
unit_cover: _.map(unit_args, makeUnitCovers)
});
grunt.loadNpmTasks('grunt-fh-build');
grunt.registerTask('default', ['fh:default']);
};