forked from vuejs/vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
115 lines (103 loc) · 2.71 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
var sauceConfig = require('./grunt/sauce')
module.exports = function (grunt) {
grunt.initConfig({
version: grunt.file.readJSON('package.json').version,
jshint: {
options: {
reporter: require('jshint-stylish'),
jshintrc: true
},
build: {
src: ['gruntfile.js', 'tasks/*.js']
},
src: {
src: 'src/**/*.js'
},
test: {
src: ['test/unit/specs/**/*.js', 'test/e2e/*.js']
}
},
watch: {
options: {
nospawn: true
},
dev: {
files: ['src/**/*.js'],
tasks: ['dev']
},
test: {
files: ['test/unit/specs/**/*.js'],
tasks: ['build-test']
}
},
karma: {
options: {
frameworks: ['jasmine', 'commonjs'],
files: [
'src/**/*.js',
'test/unit/lib/indoc_patch.js',
'test/unit/specs/**/*.js'
],
preprocessors: {
'src/**/*.js': ['commonjs'],
'test/unit/lib/indoc_patch.js': ['commonjs'],
'test/unit/specs/**/*.js': ['commonjs']
},
singleRun: true
},
browsers: {
options: {
browsers: ['Chrome', 'Firefox', 'Safari'],
reporters: ['progress']
}
},
coverage: {
options: {
browsers: ['PhantomJS'],
reporters: ['progress', 'coverage'],
preprocessors: {
'src/**/*.js': ['commonjs', 'coverage'],
'test/unit/lib/indoc_patch.js': ['commonjs'],
'test/unit/specs/**/*.js': ['commonjs']
},
coverageReporter: {
reporters: [
{ type: 'lcov' },
{ type: 'text-summary' }
]
}
}
},
sauce1: {
options: sauceConfig.batch1
},
sauce2: {
options: sauceConfig.batch2
},
sauce3: {
options: sauceConfig.batch3
}
},
coveralls: {
options: {
coverage_dir: 'coverage/',
force: true
}
}
})
// load npm tasks
grunt.loadNpmTasks('grunt-contrib-jshint')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-karma')
grunt.loadNpmTasks('grunt-karma-coveralls')
// load custom tasks
grunt.file.recurse('grunt/tasks', function (path) {
require('./' + path)(grunt)
})
grunt.registerTask('unit', ['karma:browsers'])
grunt.registerTask('cover', ['karma:coverage'])
grunt.registerTask('test', ['unit', 'cover', 'casper'])
grunt.registerTask('sauce', ['karma:sauce1', 'karma:sauce2', 'karma:sauce3'])
grunt.registerTask('ci', ['jshint', 'cover', 'coveralls', 'build', 'casper', 'sauce'])
grunt.registerTask('default', ['jshint', 'build', 'test'])
}