-
Notifications
You must be signed in to change notification settings - Fork 61
/
Gruntfile.js
executable file
·90 lines (86 loc) · 1.77 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
var grunt = require("grunt");
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-release');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-istanbul');
grunt.loadNpmTasks('grunt-browserify');
grunt.initConfig({
watch: {
scripts: {
files: ['src/**/*.js', '*.js', 'tests/*.js'
],
tasks: ['all'],
options: {
spawn: false
}
}
},
instrument: {
files: ['src/**/*.js','tests/**/*.js'],
options: {
lazy: false,
basePath: '.coverage'
}
},
jshint: {
all: ['src/**/*.js', '*.js', 'tests/**/*.js'],
options:{
esnext:true
}
},
mochaTest: {
test: {
options: {
reporter: 'spec',
clearRequireCache:true
},
src: ['tests/**/*.js']
},
cov: {
options: {
reporter: 'spec',
clearRequireCache:true
},
src: ['.coverage/tests/**/*.js']
}
},
storeCoverage: {
options: {
dir: '.coverage/reports'
}
},
makeReport: {
src: '.coverage/reports/**/*.json',
options: {
type: 'html',
dir: '.coverage/reports',
print: 'both'
}
},
release: {
options: {
bump: true,
npm: true,
npmTag: "<%= version %>"
}
},
exec: {
express: 'node --debug examples/hello-express/index.js'
},
browserify: {
dist: {
files: {
'browser/studio-with-dependecies.js': ['src/**/*.js']
}
}
}
});
grunt.registerTask("cov-test", [ "instrument","mochaTest:cov", 'storeCoverage','makeReport']);
grunt.registerTask("test", ["mochaTest:test"]);
grunt.registerTask("coverage", ["jshint","cov-test"]);
grunt.registerTask("all", ["jshint", "test"]);
grunt.registerTask("default", ["all", "watch"]);
grunt.registerTask("prod", ["all", "release"]);
grunt.registerTask("example:express", 'exec:express');