forked from Xiphe/karma-environments
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
92 lines (76 loc) · 2.11 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
91
92
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
simplemocha:
options:
ui: 'bdd'
grep: grunt.option('grep') || ''
reporter: 'dot'
unit:
src: [
'test/unit/mocha-globals.coffee'
'test/unit/**/*Spec.coffee'
]
parser:
src: [
'test/unit/mocha-globals.coffee'
'test/unit/**/headerEnvironmentParserSpec.coffee'
]
peg:
headerEnvironment:
src: 'lib/headerEnvironmentParser/parser.pegjs'
dest: 'lib/headerEnvironmentParser/parser.js'
karma:
example:
configFile: 'test/example/karma.conf.js'
watch:
andtestparser:
files: ['lib/headerEnvironmentParser/*', 'test/**/*.coffee']
tasks: ['test:parser']
andtest:
files: ['lib/**/*.coffee', 'test/**/*.coffee']
tasks: ['test:unit']
bump:
options:
updateConfigs: ['pkg']
commitFiles: ['package.json']
commitMessage: 'release v%VERSION%'
pushTo: 'origin'
'npm-publish':
options:
requires: ['test']
abortIfDirty: true
tag: 'latest'
'npm-contributors':
options:
commitMessage: 'Update contributors'
concurrent:
test:
options:
logConcurrentOutput: true
tasks: [
'karma:example'
'simplemocha:parser'
'simplemocha:unit'
]
# Load grunt tasks from NPM packages
require('load-grunt-tasks') grunt
grunt.registerTask 'build', ['peg:headerEnvironment']
grunt.registerTask 'test', (suite) ->
grunt.task.run ['build']
if suite == 'parser'
grunt.task.run ['simplemocha:parser']
else if suite == 'unit'
grunt.task.run ['simplemocha:unit']
else if suite == 'karma'
grunt.task.run ['karma:example']
else
grunt.task.run ['concurrent:test']
grunt.registerTask 'release', 'Build, bump and publish to NPM.', (type) ->
grunt.task.run [
'npm-contributors'
"bump:#{type||'patch'}:bump-only"
'test'
'bump-commit'
'npm-publish'
]