-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathGruntfile.coffee
More file actions
124 lines (110 loc) · 3.07 KB
/
Gruntfile.coffee
File metadata and controls
124 lines (110 loc) · 3.07 KB
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
116
117
118
119
120
121
122
123
124
'use strict'
module.exports = (grunt) ->
_ = require 'underscore'
require 'coffee-errors'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-coffeelint'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-mocha-test'
grunt.loadNpmTasks 'grunt-istanbul'
grunt.loadNpmTasks 'grunt-notify'
grunt.registerTask 'test', [ 'coffeelint','coffee:multiple', 'mochaTest:spec' ]
grunt.registerTask 'coverage', [ 'clean','copy', 'instrument', 'mochaTest:coverage', 'storeCoverage', 'makeReport']
grunt.registerTask 'travis', [ 'test','coverage']
grunt.registerTask 'default', [ 'test', 'watch' ]
grunt.initConfig
coffeelint:
options:
max_line_length:
value: 120
indentation:
value: 2
newlines_after_classes:
level: 'error'
no_empty_param_list:
level: 'error'
no_unnecessary_fat_arrows:
level: 'ignore'
dist:
files: [
{ expand: yes, cwd: 'test/', src: [ '*.coffee' ] }
{ expand: yes, cwd: './', src: [ '*.coffee' ] }
{ expand: yes, cwd: 'models/', src: [ '**/*.coffee' ] }
{ expand: yes, cwd: 'config/', src: [ '**/*.coffee' ] }
{ expand: yes, cwd: 'events/', src: [ '**/*.coffee' ] }
{ expand: yes, cwd: 'src/', src: [ '**/*.coffee' ] }
{ expand: yes, cwd: 'public/', src: [ '**/*.coffee' ] }
]
watch:
options:
interrupt: yes
dist:
files: [
'*.coffee'
'models/**/*.coffee'
'events/**/*.coffee'
'config/**/*.coffee'
'src/**/*.coffee'
'public/**/*.{coffee,js,jade}'
'test/**/*.coffee'
]
tasks: [ 'coffeelint','coffee','mochaTest:spec' ]
coffee:
multiple:
expand:true
cwd:'src'
src:'*.coffee'
dest:'lib/'
ext:'.js'
test:
expand:true
cwd:'test'
src:'*.coffee'
dest:'coverage/test/'
ext:'.js'
test_lib:
expand:true
cwd:'src'
src:'*.coffee'
dest:'coverage/lib/'
ext:'.js'
copy:
coverage:
files: [
expand: true
src: ['test/**']
dest: 'coverage/instrument/'
]
clean:
coverage:
src: ['coverage/']
# Istanbul(MochaTest+Coverage Report)
instrument:
files: "lib/*.js"
options:
lazy: true
basePath: "coverage/instrument/"
mochaTest:
spec:
options:
reporter:"spec"
timeout: 50000
colors: true
src: ['test/**/*.coffee']
coverage:
options:
reporter:"spec"
timeout: 50000
colors:true
src: ['coverage/instrument/test/*.coffee']
storeCoverage:
options:
dir: "coverage/reports"
makeReport:
src: "coverage/reports/**/*.json"
options:
type: "lcov"
dir: "coverage/reports"
print: "detail"