-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
90 lines (80 loc) · 1.7 KB
/
Gruntfile.coffee
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
module.exports = (grunt) ->
[
'grunt-contrib-coffee'
'grunt-contrib-jasmine'
'grunt-contrib-watch'
'grunt-coveralls'
'grunt-ngmin'
]
.forEach grunt.loadNpmTasks
# task sets
build = ['ngmin']
test = ['coffee', 'jasmine:unit']
coverage = ['coffee', 'jasmine:coverage']
# task defs
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
coffee:
files:
'test/test.js': 'test/test.coffee'
coveralls:
options:
force: true
main:
src: 'reports/lcov/lcov.info'
jasmine:
coverage:
src: [
'./src/<%= pkg.name %>.js'
]
options:
specs: ['./test/test.js']
template: require 'grunt-template-jasmine-istanbul'
templateOptions:
coverage: 'reports/lcov/lcov.json'
report: [
{
type: 'html'
options:
dir: 'reports/html'
}
{
type: 'lcov'
options:
dir: 'reports/lcov'
}
]
type: 'lcovonly'
vendor: [
'./bower_components/angular/angular.js'
'./bower_components/angular-mocks/angular-mocks.js'
]
unit:
src: './src/<%= pkg.name %>.js'
options:
specs: './test/test.js'
vendor: [
'./bower_components/angular/angular.js'
'./bower_components/angular-mocks/angular-mocks.js'
]
keepRunner: true
ngmin:
main:
src: ['./src/<%= pkg.name %>.js']
dest: './dist/<%= pkg.name %>.js'
watch:
main:
files: './src/*'
tasks: build
options:
interrupt: true
spawn: false
test:
files: './test/*.js'
tasks: test
options:
interrupt: true
spawn: false
grunt.registerTask 'default', build
grunt.registerTask 'test', test
grunt.registerTask 'coverage', coverage