theorchard/lemon-js — pull request #7 by mortaliorchard (2014-11-17 19:04:53+00:00)
Title: Karma Test Library for Lemon Views

==================================

Writting tests for views can be a bit lengthy and can require a lot of
manual work. This library automates the creation of the view, and bundle
all the automated tests (which are part of the yml files.)

Example of library usage:

```js
goog.require('lemon.tests');

goog.require('app.ViewName');
goog.require('app.ViewName.yml');

describe('ViewName', function() {
var tests = lemon.tests.init(app.ViewName, app.ViewName.yml);

tests.describe('Test 1', null, function(view) {
// test.
});
});
```

If you have 5 tests in the yml file, you will see the following
scenario:

- Run all the 5 tests of the yml file.
- Run the test "Test 1" within the successful test of the yml file.

If 4 tests out of 5 are successful, it means that 9 tests will have ran. Those
tests answer the questions:

* Can this view be rendered under all valid conditions?
* Can all the states on this view work with the javascript?