forked from jembi/openhim-core-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
65 lines (56 loc) · 1.52 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
'use strict'
files =
src: './src/**/*.coffee'
test: './test/**/*.coffee'
module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-coffeelint'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-mocha-cli'
grunt.loadNpmTasks 'grunt-contrib-watch'
# increase mocha timeout if these tests are being run on TRAVIS
mochaTimeout = 2000 # default mocha timeout
if process.env.TRAVIS
mochaTimeout = 15000
grunt.initConfig
clean: ['./lib/']
coffee:
compile:
options:
bare: true
sourceMap: true
expand: true
cwd: './src/'
src: '**/*.coffee'
dest: './lib/'
ext: '.js'
coffeelint:
options:
configFile: 'coffeelint.json'
src:
files:
src: [files.src]
test:
files:
src: [files.test]
mochacli:
options:
reporter: 'spec'
flags: ['--harmony']
compilers: ['coffee:coffee-script/register']
env:
NODE_ENV: 'test'
NODE_TLS_REJECT_UNAUTHORIZED: 0
grep: grunt.option 'mochaGrep' || null
debug: grunt.option 'debugTests' || false
bail: grunt.option 'bail' || false
timeout: mochaTimeout
all:
files.test
watch:
src:
files: files.src
tasks: ['build']
grunt.registerTask 'build', ['clean', 'coffee']
grunt.registerTask 'lint', ['coffeelint']
grunt.registerTask 'test', ['coffeelint:src', 'build', 'mochacli']