Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Example setup to BDD an express.js application
JavaScript
branch: master

Merge pull request #5 from oldfartdeveloper/master

Fix path on the makefile target 'spec-client'
latest commit b2021b3441
Olivier Melcher authored

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.