blob: 213b4841cbdd8b9aaba0cc60365bd628ce59b0f4 [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
Simon Hunt8ead3a22015-01-06 11:00:15 -08008From the karma installation directory, execute the following:
Simon Hunt420691a2014-12-16 20:16:28 -08009
Simon Hunt8ead3a22015-01-06 11:00:15 -080010 $ karma start {_path_to_}/src/main/webapp/tests/karma.conf.js
11
12This will launch and capture a browser, install and run the unit tests.
13
14The configuration is currently set to re-run the tests every time a
15file change is detected, (i.e. each time a source file is saved).
Simon Hunt51fc40b2015-01-06 13:56:12 -080016
17----------------------------------------------------------------------
18Useful Notes
19============
20
21Set a 'breakpoint' with the debugger command:
22
23 it('should define four functions', function () {
24 debugger;
25
26 expect(fs.isF(gs.init)).toBeTruthy();
27 // ...
28 });
29
30Open Developer Tools in the captured Chrome browser, and reload the page.
31The debugger will break at the given point, allowing you to inspect context.