-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
87 lines (77 loc) · 2.19 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
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-karma-coveralls');
grunt.initConfig({
pkg: grunt.file.readJSON('bower.json'),
concat: {
options: {
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */\n',
},
build: {
src: ['src/taggedAutogrow.js'],
dest: 'taggedAutogrow.js'
},
},
coveralls: {
options: {
coverageDir: 'coverage/'
}
},
karma: {
options: {
configFile: 'config/karma.conf.js'
},
test: {
// Use defaults
},
dev: {
singleRun: false
},
bdd: {
reporters: ['story', 'coverage']
},
cobertura: {
reporters: ['dots', 'coverage'],
browsers: ['PhantomJS'],
coverageReporter: {
type : 'cobertura',
dir : 'coverage/'
}
},
travis: {
singleRun: true,
reporters: ['dots', 'coverage'],
browsers: ['PhantomJS'],
preprocessors: {
'src/*.js': 'coverage'
},
coverageReporter: {
type : 'lcov',
dir : 'coverage/'
}
}
},
uglify: {
build: {
files: {
'taggedAutogrow.min.js': ['taggedAutogrow.js']
}
}
}
});
// Run tests, single pass
grunt.registerTask('test', 'Run unit tests', ['karma:test']);
// Run tests continously for development mode
grunt.registerTask('dev', 'Run unit tests in watch mode', ['karma:dev']);
// Generate a coverage report in Cobertura format
grunt.registerTask('cobertura', 'Generate Cobertura coverage report', ['karma:cobertura']);
// Build files for production
grunt.registerTask('build', 'Builds files for production', ['concat:build', 'uglify:build']);
// Travis CI task
// Disabling coveralls for now until we change our github repo name in coveralls to "ifwe"
grunt.registerTask('travis', 'Travis CI task', ['karma:travis'/*, 'coveralls'*/]);
};