-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
86 lines (80 loc) · 2.14 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
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['app/scripts/ng-http-circuitbreaker.js']
}
}
},
copy: {
main: {
files: [
{src: ['app/scripts/ng-http-circuitbreaker.js'], dest: 'dist/<%=pkg.name %>.js' },
]
}
},
jshint: {
options: {
smarttabs: true,
curly: true,
eqeqeq: true,
immed: true,
newcap: true,
noarg: true,
sub: true,
eqnull: true,
unused: true,
browser: true,
validthis: true,
strict: true,
latedef: true,
globals: {
angular: true
}
},
source: {
src: ['app/scripts/ng-http-circuitbreaker.js']
}
},
karma: {
unit: {
configFile: './test/karma-unit.conf.js',
autoWatch: false,
singleRun: true
},
unit_auto: {
configFile: './test/karma-unit.conf.js',
autoWatch: true,
singleRun: false
},
unit_coverage: {
configFile: './test/karma-unit.conf.js',
autoWatch: false,
singleRun: true,
reporters: ['progress', 'coverage'],
preprocessors: {
'app/scripts/*.js': ['coverage']
},
coverageReporter: {
type : 'html',
dir : 'coverage/'
}
},
}
});
//single run tests
grunt.registerTask('test', ['jshint','karma:unit']);
//coverage testing
grunt.registerTask('test:coverage', ['jshint','karma:unit_coverage']);
//autotest and watch tests
grunt.registerTask('autotest', ['jshint','karma:unit_auto']);
grunt.registerTask('build', ['jshint','karma:unit','copy:main','uglify']);
//defaults
grunt.registerTask('default', ['test']);
};