-
Notifications
You must be signed in to change notification settings - Fork 49
/
Gruntfile.js
60 lines (51 loc) · 1.55 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
jshintrc: true
},
files: {
src: ['angular-loggly-logger.js']
}
},
uglify: {
options : {
sourceMap: true
},
main: {
files: { 'angular-loggly-logger.min.js': ['angular-loggly-logger.js'] }
}
},
karma: {
unit: {
configFile: 'karma.conf.js'
},
//continuous integration mode: run tests once in PhantomJS browser.
travis: {
configFile: 'karma.conf.js',
singleRun: true,
browsers: ['Firefox']
}
},
watch: {
//run JSHint on JS files
jshint: {
files: ['angular-loggly-logger.js'],
tasks: ['jshint']
},
//run unit tests with karma (server needs to be already running)
karma: {
files: ['*.js', '!*.min.js'],
tasks: ['karma:unit:run'] //NOTE the :run flag
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-karma');
grunt.registerTask('default', ['jshint','uglify', 'test-all'] );
grunt.registerTask('test', [ 'karma:travis' ] );
grunt.registerTask('test-all', ['karma:unit'] );
};