JasmineNode guard automatically & intelligently executes jasmine node specs when files are modified.
It works brilliantly with Node projects whereas guard-jasmine looks better for jasmine specs in the context of e.g. a Rails app.
- Tested against Node 0.8.9, jasmine-node 1.0.26
Install the gem:
$ gem install guard-jasmine-node
Add guard definition to your Guardfile by running this command:
$ guard init jasmine-node
This will watch your project and execute your specs when files change. It's worth checking out the docs.
:all_on_start # default => true
Run all the specs as soon as Guard is started.
:all_after_pass # default => true
When files are modified and the specs covering the modified files pass, run all the specs automatically.
:keep_failed # default => true
When files are modified, run failing specs as well as specs covering the modified files.
:notify # default => true
Display growl/libnotify notifications.
:coffeescript # default => true
Load coffeescript and all execution of .coffee files.
:forceexit # default => false
Force jasmine-node process to quit after test (can help fix hanging specs)
:verbose # default => false
Execute jasmine-node in verbose mode
:spec_paths # default => [spec]
Array of paths containing all specs (supply a comma-separated list of paths to override the default)
Specify the path to the jasmine-node binary that will execute your specs.
:jasmine_node_bin in the Guardfile assumes:
- you are running guard from the root of the project
- you installed jasmine-node using npm
- you installed jasmine-node locally to node_modules
If you delete the option completely from the Guardfile, it assumes the
jasmine-node binary is already in your
So if you have installed jasmine-node globally using e.g.
npm install -g jasmine-node, remove the
:jasmine_node_bin option from the Guardfile.
Please read the guard docs for more information about the Guardfile DSL.
It's powerful stuff.
Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change you make.
- write a JsonFormatter for jasmine-node so we have finer-grained control over rendering output
- write an RSpec-style progress formatter (aka lots of green dots)
- patch Guard to locate CamelCased modules correctly
Ruby >= 1.9 required.