-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCakefile
More file actions
26 lines (24 loc) · 895 Bytes
/
Cakefile
File metadata and controls
26 lines (24 loc) · 895 Bytes
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
spawn = require('child_process').spawn
colors = require 'colors'
pipe = (p)->
p.stdout.on 'data', (d)->
console.log d.toString()
p.stderr.on 'data', (d)->
console.log d.toString()
task 'dev', 'compile coffee and put into correct dirs', ->
s = spawn __dirname + '/node_modules/.bin/coffee', ['-o', 'lib/', '-cw', 'coffee/']
pipe s
# mocha test
test = (callback, env = process.env) ->
try
cmd = __dirname + '/node_modules/.bin/mocha'
process.env.NODE_PATH = process.cwd() + '/Resources'
spec = spawn cmd, ['--compilers','coffee:coffee-script','--colors','--require','should', '-R', 'landing', '--timeout', '5500']
pipe spec
spec.on 'exit', (status) -> callback?() if status is 0
catch err
console.log err.message.red
console.log 'Mocha is not installed - try npm install mocha -g'.red
task 'test', 'mocha',->
test ->
console.log 'complete'