Created
January 11, 2014 21:19
-
-
Save albertosouza/8377013 to your computer and use it in GitHub Desktop.
Cakefile for run sails.js testes with mocha config and suport to --grep <string> option
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cakefile | |
{exec} = require "child_process" | |
option '', '--grep [string]', 'only run tests matching <pattern>' | |
REPORTER = "spec" | |
task "test", "run all tests", (options)-> | |
grep | |
grep = ('--grep ' + options.grep) if options.grep | |
exec "NODE_ENV=test | |
./node_modules/.bin/mocha | |
--reporter #{REPORTER} | |
--require tests/testHelper.js | |
--colors | |
"+grep+" | |
--ui bdd | |
tests/index.js | |
", (err, output) -> | |
console.error err if err | |
console.log output | |
task "test_bail", "bail after first test failure", (options)-> | |
grep | |
grep = ('--grep ' + options.grep) if options.grep | |
exec "NODE_ENV=test | |
./node_modules/.bin/mocha | |
--reporter #{REPORTER} | |
--require tests/testHelper.js tests/index.js | |
--colors | |
--growl | |
"+grep+" | |
--ui bdd | |
", (err, output) -> | |
console.error err if err | |
console.log output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment