Skip to content

Files

Latest commit

1f69c15 · Oct 3, 2018

History

History

tests

Guidelines for Testing in Bliss

Please don't use any Bliss functions in your tests except for the function you're testing. We want to make it easy to find those pesky bugs. ;)

Please use HTML fixtures whenever possible vs creating DOM elements with JS. This will make the tests much shorter and more readable, by separating the HTML from the Javascript. View Example

Please use spies or stubs for callbacks whenever possible. This makes the tests more readable and easier to make assertions on the callback function. View Example
More info on Sinon here

Setup

Install Karma, by running:

npm install karma --save-dev

Then install the Command Line tools:

npm install -g karma-cli

Running the tests

cd to the root of the project

For TDD development.

karma start

Karma will now monitor your tests directory for any files with *Spec.js, and run them on change!

For a single run

npm test