Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Example setup to BDD an express.js application

branch: master

Merge pull request #5 from oldfartdeveloper/master

Fix path on the makefile target 'spec-client'
latest commit b2021b3441
Olivier Melcher authored
Octocat-spinner-32 app cleanup December 06, 2011
Octocat-spinner-32 log Refactor the World December 06, 2011
Octocat-spinner-32 node_modules Cuke this app now! Aye aye captain :) December 06, 2011
Octocat-spinner-32 test Refactor the World December 06, 2011
Octocat-spinner-32 .gitignore Refactor the World December 06, 2011
Octocat-spinner-32 Makefile Fixed path on the makefile target 'spec-client' February 20, 2012
Octocat-spinner-32 README.md Refactor the World December 06, 2011
Octocat-spinner-32 package.json Cuke this app now! Aye aye captain :) December 06, 2011
Octocat-spinner-32 server.js add debug level to logger December 06, 2011
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.