Skip to content
Andrew Smith edited this page Jan 31, 2015 · 1 revision

Testing suite

All tests run by command gulp test. The command npm test delegates to this command.

  • gulp lint - checks JS files for syntax or style mistakes
  • gulp karma - runs client-side specs
    • Uses mocha, chai, and Chrome
  • gulp mocha - runs server-side specs
    • Uses mocha, chai, and supertest

Linting

gulp lint

Uses JSHint, the friendlier and less dogmatic version of JSLint. Combined with careful adherence to the style guide, JSHint helps keep code clean and uniform. Options are defined in file .jshintrc at root level.

Client-Side

gulp karma

Runs Karma test running for client-side tests. Configuration in file spec/karma.conf.js. Runs tests off Chrome browser. Special configuration present to allow Chrome browser testing in Travis, see the CI wiki page.

Server-Side

gulp mocha

Runs mocha framework for server-side tests. Uses 20 sec timeout to allow for some slower interactions with backend technologies, namely Cloudinary.

Spec files are thoroughly commented.

Clone this wiki locally