-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
68 lines (61 loc) · 1.96 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
63
64
65
66
67
module.exports = function(grunt) {
"use strict";
grunt.initConfig({
"pkg": grunt.file.readJSON("package.json"),
"uglify": {
"options": { "preserveComments": "some" },
"poirot": { "files": { "dist/poirot.min.js": "poirot.js" } }
},
"jshint": {
"jsfiles": { "src": ["*.js"] },
"options": { "jshintrc": true }
},
"node-qunit": {
"test": {
"code": { "path": "poirot.js", "namespace": "poirot" },
"tests": "test_poirot.js"
}
},
/*
* Coverage tasks
*/
"clean": {
"files": ["instrument"]
},
"copy": {
"test": {
"src": ["test_poirot.js"],
"dest": "instrument/"
}
},
"instrument": {
"files": ["poirot.js"],
"options": { "basePath": "instrument/" }
},
"nodeunit": {
"test": ["test_poirot.js"],
"coverage": ["instrument/test_poirot.js"]
},
"storeCoverage": {
"options": { "dir": "instrument/" }
},
"makeReport": {
"src": "instrument/*.json",
"options": {
"type": "lcov",
"print": "summary",
"dir": "instrument"
}
}
});
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-nodeunit");
grunt.loadNpmTasks("grunt-node-qunit");
grunt.loadNpmTasks("grunt-istanbul");
grunt.registerTask("default", ["jshint", "test", "uglify"]);
grunt.registerTask('test', [ 'node-qunit', 'nodeunit:test', 'cov' ]);
grunt.registerTask('cov', ['clean', 'copy', 'instrument', 'nodeunit:coverage', 'storeCoverage', 'makeReport']);
};