forked from cfpb/hmda-edit-check-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
39 lines (32 loc) · 1.27 KB
/
Gruntfile.js
File metadata and controls
39 lines (32 loc) · 1.27 KB
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
'use strict';
module.exports = function (grunt) {
// Load the project's grunt tasks from a directory
require('grunt-config-dir')(grunt, {
configDir: require('path').resolve('tasks')
});
/*
* Register group tasks
*/
//npm install
grunt.registerTask('npm_install', 'install dependencies', function() {
var exec = require('child_process').exec;
var cb = this.async();
exec('npm install', {cwd: './'}, function(err, stdout) {
console.log(stdout);
cb();
});
});
grunt.registerTask('open_coverage', 'open coverage report in default browser', function() {
var exec = require('child_process').exec;
var cb = this.async();
exec('open coverage/lcov-report/index.html', {cwd: './'}, function(err, stdout) {
console.log(stdout);
cb();
});
});
grunt.registerTask('clean_all', [ 'clean:node_modules', 'clean:coverage', 'npm_install' ]);
grunt.registerTask('test', ['env:test', 'clean:coverage', 'jshint', 'mocha_istanbul']);
grunt.registerTask('coverage', ['test', 'open_coverage']);
grunt.registerTask('dist', ['compress:hmda-edit-check-api']);
grunt.registerTask('serve', ['env:sandbox', 'jshint','develop','watch']);
};