This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathGruntfile.js
62 lines (53 loc) · 1.76 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
52
53
54
55
56
57
58
59
60
61
62
var _ = require('underscore');
module.exports = function(grunt) {
'use strict';
function makeTestArgs(testFile) {
return ['-u exports --recursive -t 10000 ', testFile].join(' ');
}
function makeUnits(testArgString) {
return [test_runner, testArgString].join(' ');
}
function makeUnitCovers(testArgString) {
return ['istanbul cover --dir cov-unit', test_runner, '--', testArgString].join(' ');
}
// TODO: move these to use the grunt-mocha-test plugin
var tests = [ /* If updating this list of tests, also update test_win.cmd for Windows */
'./test/test_mongodbQueue.js',
'./test/test_index.js',
'./test/test_worker.js',
'./test/test_sync-processor.js',
'./test/test_sync-scheduler.js',
'./test/test_ack-processor.js',
'./test/test_pending-processor.js',
'./test/test_hashProvider.js',
'./test/test_api-sync.js',
'./test/test_dataHandlers.js',
'./test/test_api-syncRecords.js',
'./test/test_default-dataHandlers.js',
'./test/test_interceptors.js',
'./test/test_lock.js',
'./test/test_datasetClientsCleaner.js',
'./test/test_sync-metrics.js'
];
var unit_args = _.map(tests, makeTestArgs);
var test_runner = '_mocha';
// Just set shell commands for running different types of tests
grunt.initConfig({
mochaTest: {
integration: {
options: {
ui: 'exports',
reporter: 'spec',
timeout: 30000
},
src: ['integration/**/test*.js']
}
},
// These are the properties that grunt-fh-build will use
unit: _.map(unit_args, makeUnits),
unit_cover: _.map(unit_args, makeUnitCovers)
});
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-fh-build');
grunt.registerTask('default', ['fh:default']);
};