Skip to content

Commit

Permalink
Add frontend tests to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
shamoon committed Mar 31, 2022
1 parent be2b594 commit 70bc70e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ it fixed for everyone!
Before contributing please review our `code of conduct`_ and other important
information in the `contributing guidelines`_.

.. _code-formatting-with-pre-commit-hooks:

Code formatting with pre-commit Hooks
=====================================

Expand Down Expand Up @@ -183,6 +185,31 @@ X-Frame-Options are in place so that the front end behaves exactly as in product
relies on you being logged into the back end. Without a valid session, The front end will simply
not work.

Testing and code style:

* The frontend code (.ts, .html, .scss) use ``prettier`` for code formatting via the Git
``pre-commit`` hooks which run automatically on commit. See
:ref:`above <code-formatting-with-pre-commit-hooks>` for installation. You can also run this
via cli with a command such as

.. code:: shell-session
$ git ls-files -- '*.ts' | xargs pre-commit run prettier --files
* Frontend testing uses jest and cypress. There is currently a need for significantly more
frontend tests. Unit tests and e2e tests, respectively, can be run non-interactively with:

.. code:: shell-session
$ ng test
$ npm run e2e:ci
Cypress also includes a UI which can be run from within the ``src-ui`` directory with

.. code:: shell-session
$ ./node_modules/.bin/cypress open
In order to build the front end and serve it as part of django, execute

.. code:: shell-session
Expand Down

0 comments on commit 70bc70e

Please sign in to comment.