Created
May 14, 2013 19:42
-
-
Save techieBrandon/5578866 to your computer and use it in GitHub Desktop.
node watch.js
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
//Simply run your headless jasmine specs in parallel to your daily coffeescript work | |
//Usage: node watch.js | |
var sys = require('sys'); | |
var exec = require('child_process').exec; | |
var watch = require('watch') | |
function puts(error, stdout, stderr) { | |
if(stdout!=undefined){sys.puts(stdout);} if(error!=undefined){sys.puts(error);} if(stderr!=undefined){sys.puts(stderr);} } | |
function headlessJasmineSpecRunner(){ exec("jasmine-headless-webkit -c -j spec/jasmine.yml", puts); } | |
watch.createMonitor('./',function (monitor) { | |
monitor.files['./'] // Stat object for my zshrc. | |
monitor.on("changed", function (f, curr, prev) { | |
if(/\.coffee$/.test(f)){ | |
headlessJasmineSpecRunner(); | |
} | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment