blob: 831bf9a48208d67f90899008ee3446154acfa916 [file] [log] [blame]
Simon Hunt8ead3a22015-01-06 11:00:15 -08001####
Simon Huntf3069722014-12-16 18:15:37 -08002# Unit and integration tests for code under the /app directory
Simon Hunt8ead3a22015-01-06 11:00:15 -08003####
Simon Hunt420691a2014-12-16 20:16:28 -08004
5To run these tests, karma, node.js etc needs to be installed in the
6build environment.
7
Matteo Scandolo812aa5a2016-04-19 18:12:45 -07008Once Node.js is installed from this folder execute:
Simon Hunt420691a2014-12-16 20:16:28 -08009
Matteo Scandolo812aa5a2016-04-19 18:12:45 -070010 $ npm install
11
12And then execute the following:
13
14 $ npm test
Simon Hunt8ead3a22015-01-06 11:00:15 -080015
16This will launch and capture a browser, install and run the unit tests.
17
Matteo Scandolo812aa5a2016-04-19 18:12:45 -070018To re-run the tests every time a
19file change is detected, (i.e. each time a source file is saved) use:
20
21 $ npm run test:dev
Simon Hunt51fc40b2015-01-06 13:56:12 -080022
23----------------------------------------------------------------------
24Useful Notes
25============
26
27Set a 'breakpoint' with the debugger command:
28
29 it('should define four functions', function () {
30 debugger;
31
32 expect(fs.isF(gs.init)).toBeTruthy();
33 // ...
34 });
35
36Open Developer Tools in the captured Chrome browser, and reload the page.
37The debugger will break at the given point, allowing you to inspect context.
Matteo Scandolo812aa5a2016-04-19 18:12:45 -070038
39----------------------------------------------------------------------
Matteo Scandolo812aa5a2016-04-19 18:12:45 -070040