-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
58 lines (49 loc) · 1.35 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
path = require 'path'
module.exports = (grunt) ->
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-mocha-test')
grunt.loadNpmTasks('grunt-shell')
grunt.initConfig
pkg: grunt.file.readJSON('package.json'),
coffee: {
source: {
expand: true,
flatten: false,
cwd: 'src/',
src: ['**/*.coffee'],
dest: 'lib/',
ext: '.js'
}
},
mochaTest: {
test: {
options: {
reporter: 'spec',
require: 'coffee-script/register'
},
src: ['tests/*.coffee']
},
coverage: {
options: {
reporter: 'mocha-lcov-reporter'
require: './support/coffee-coverage.js'
captureFile: './lcov.txt'
quiet: true
},
src: ['tests/*-tests.coffee']
}
},
shell: {
publish: {
command: 'npm publish'
}
coveralls: {
command: "cat ./lcov.txt | #{path.join(__dirname, 'node_modules', '.bin', 'coveralls')}"
}
testApp: {
command: "#{path.join(__dirname, 'node_modules', '.bin', 'coffee')} ./support/test-app.coffee"
}
}
grunt.registerTask 'test', ['mochaTest:test']
grunt.registerTask 'coverage', ['mochaTest:coverage', 'shell:coveralls']
grunt.registerTask 'publish', ['coffee', 'shell:publish']