Created
April 25, 2012 11:01
-
-
Save gerhard/2488954 to your computer and use it in GitHub Desktop.
guard-mocha
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
#!/usr/bin/env sh | |
all_tests=$(find ./test -type f -name "*test.coffee") | |
./node_modules/mocha/bin/mocha test/_helper.js ${1:-$all_tests} |
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
source 'http://rubygems.org' | |
gem 'guard' | |
gem 'guard-shell' |
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
guard 'shell' do | |
watch(%r{^(test/.*_test\.coffee)$}) { |m| system("./bin/mocha #{m[1]}") } | |
watch(%r{^lib/(.+)([^/]+)\.coffee$}) { |m| system("./bin/mocha test/lib/#{m[1]}#{m[2]}_test.coffee") } | |
end |
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
process.env.NODE_ENV = 'test'; | |
require('coffee-script'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I really love my guard & guard-minitest integration. Couldn't live without them, so here is my mocha port. Brownie points for what
./bin/mocha
defaults to.