forked from mcollina/qest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCakefile
More file actions
33 lines (26 loc) · 1.05 KB
/
Cakefile
File metadata and controls
33 lines (26 loc) · 1.05 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
child_process = require('child_process')
process = global.process
path = require('path')
runExternal = (command, callback) ->
console.log("Running #{command}")
child = child_process.spawn("/bin/sh", ["-c", command])
child.stdout.on "data", (data) -> process.stdout.write(data)
child.stderr.on "data", (data) -> process.stderr.write(data)
child.on('exit', callback) if callback?
launchSpec = (args, callback) ->
runExternal "NODE_ENV=test ./node_modules/.bin/mocha --compilers coffee:coffee-script #{args}", callback
task "spec", ->
launchSpec "--recursive test", (result) ->
process.exit(result)
task "spec:ci", ->
launchSpec "--watch --recursive test"
task "features", ->
runExternal "NODE_ENV=test ./node_modules/.bin/cucumber.js -t ~@wip", (result) ->
if result != 0
console.log "FAIL: scenarios should not fail"
process.exit(result)
task "features:wip", ->
runExternal "NODE_ENV=test ./node_modules/.bin/cucumber.js -t @wip", (result) ->
if result == 0
console.log "FAIL: wip scenarios should fail"
process.exit(1)