Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Example setup to BDD an express.js application
JavaScript
Branch: master
Pull request Compare This branch is 1 commit behind olivoil:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
log
node_modules
test
.gitignore
Makefile
README.md
package.json
server.js

README.md

Example app showing how to setup a test environment for an express.js application

It uses cucumber.js with zombie.js for integration testing, mocha with should.js for unit testing on the server side, and jasmine with sinon for unit testing on the client side.

Install

$ git clone git://github.com/olivoil/NodeBDD.git
$ cd NodeBDD
$ npm install --dev

The Makefile defines commands to run the different kinds of tests:

Run cucumber features

$ make cucumber

If you are using vim, you might find it helpful to map a key to run them:

:map <Leader>f :w\|!clear && make cucumber<cr>

Run server-side specs

$ make spec

If you are using vim, you might find it helpful to map a key to run them:

:map <Leader>t :w\|!clear && make spec<cr>

Run client-side specs

$ make spec-client

If you are using vim, you might find it helpful to map a key to run them:

:map <Leader>c :w\|!make spec-client<cr>

TODO

  • Example client-side tests, stubbing the server side with sinon
  • Figure out how to make should.js work in the browser, then replace jasmine by mocha
  • Setup performance tests
  • Setup test coverage reporting
  • cli reporting for client-side specs, maybe using Phantomjs?
  • Browser Interface for all test reporting
Something went wrong with that request. Please try again.