Upgrade to Pro — share decks privately, control downloads, hide ads and more …

test your nodejs code

test your nodejs code

an opinionated introduction by Damien Klinnert

damienklinnert

September 27, 2012
Tweet

More Decks by damienklinnert

Other Decks in Programming

Transcript

  1. whois damienklinnert student of computer science works at doctape jsdev

    since beginning of 2012 follow me @damienklinnert 2 Donnerstag, 27. September 12
  2. advantages of unit tests JS is a dynamic language additional

    lines of code, but less errors continous integration -> less errors over time NOT THE ANSWER TO EVERYTHING 5 Donnerstag, 27. September 12
  3. tools/mocha feature-rich JavaScript test framework many different test outputs can

    create documentation only a few keywords to remember like: describe(), it(), before(), after(), beforeEach(), afterEach() 8 Donnerstag, 27. September 12
  4. tools/should expressive, readable, test framework agnostic, assertion library extends the

    Object prototype should … exist, have.keys, equal, throwError() 9 Donnerstag, 27. September 12
  5. tools/npm npm comes with script support no need for makefiles

    for common tasks like "run all tests" or "generate docs" 10 Donnerstag, 27. September 12
  6. tools/couchviews Store and load CouchDB views to / from your

    file system for easier setup of new databases 12 Donnerstag, 27. September 12
  7. tools/couchpenter CouchDB database and document setup tool CLI to setup

    new couchdb‘s from a json file 13 Donnerstag, 27. September 12
  8. reading http:/ /visionmedia.github.com/mocha/ https:/ /github.com/visionmedia/should.js/ https:/ /npmjs.org/doc/ https:/ /github.com/damienklinnert/couchviews https:/

    /github.com/cliffano/couchpenter https:/ /github.com/flatiron/nock http:/ /travis-ci.org/ 16 Donnerstag, 27. September 12