openATTIC Web UI Tests - Unit Tests

openATTIC Web UI has both Unit and E2E tests. This section is related to Unit tests, if you are looking for E2E tests documentation please refer to openATTIC Web UI Tests - E2E Test Suite.

Unit tests are implemented in *.spec.js files, which must be in the same directory as the file being tested:

+-- oa-sample
|   '-- oa-sample.service.js
|   '-- oa-sample.service.specjs

Run Unit Tests

To run openATTIC Web UI unit tests, you should guarantee that your dependencies are updated ($ npm install), and perform the following command:

$ npm test

Coverage Report

After running the unit tests, an HTML coverage report will be generated into coverage directory. To open this coverage report you should use a web browser, e.g.:

$ firefox coverage/index.html


For more information on the tools that are used by the Web UI unit tests, see: