1
0
Fork 0
arangodb/Documentation/Books/Users/UsingJsUnity
Thomas Schmidts 55aa1645ac Changes in the code documentation 2014-07-02 09:51:26 +02:00
..
README.mdpp Changes in the code documentation 2014-07-02 09:51:26 +02:00

README.mdpp

!CHAPTER Using jsUnity and node-jscoverage


!SUBSECTION jsUnity

The ArangoDB contains a wrapper for [jsUnity](http://jsunity.com/), a
lightweight universal JavaScript unit testing framework.

!SUBSECTION Running jsUnity Tests

Assume that you have a test file containing

```js
function aqlTestSuite () {
  return {
testSizeOfTestCollection : function () {
  assertEqual(5, 5);
  };
}

jsUnity.run(aqlTestSuite);

return jsunity.done();
```

Then you can run the test suite using *jsunity.runTest*

```js
unix> ju.runTest("test.js");
2012-01-28T19:10:23Z [10671] INFO Running aqlTestSuite
2012-01-28T19:10:23Z [10671] INFO 1 test found
2012-01-28T19:10:23Z [10671] INFO [PASSED] testSizeOfTestCollection
2012-01-28T19:10:23Z [10671] INFO 1 test passed
2012-01-28T19:10:23Z [10671] INFO 0 tests failed
2012-01-28T19:10:23Z [10671] INFO 1 millisecond elapsed
```