This is an example app for my talk "Testing your Backbone from the outside-in" given at ScotlandJS in June 2012.
Functionally, all it does is allow a snippet to be saved, and a success message to be displayed when the server has successfully completed the save.
There are very simple examples of acceptance / functional tests using both CasperJS and Cucumber.js / Zombie and unit tests using BusterJS.
- Clone the project
> cd
to the project directory> npm install
to install dependencies locally frompackage.json
> npm link
Both CasperJS and Cucumber.js acceptance tests require the app to run. Start the app server with:
> supervisor app.js
Supervisor allows hot code reloading of Node.js applications without restarting the web server.
There are 2 very simple acceptance tests using CasperJS, a scripting, testing and navigation utility for the PhantomJS headless web browser in test/functional
.
To run tests:
> casperjs test test/functional
There are 2 very simple cucumber.js scenarios that can be run. These use the zombie headless browser. Features are in the features
directory, along with step definitions and cucumber.js setup.
To run the scenarios:
> cucumber.js
There is a small suite of Buster.js unit specs in BDD style in the spec
directory.
To run specs, start the buster server with:
> buster server
Then, navigate any number of slave browsers to the buster server at http://localhost:1111
Run specs with:
> buster test --reporter specification
or simply:
> buster test
for less verbose output.