Skip to main content

Frontend testing

Front end apps on vets-website should have unit tests and end-to-end tests. It is the application team's responsibility to create and maintain adequate automated test coverage for their applications.

Test Type

Test All

Test One

Requires Local Build to Run

Test Target


yarn test:unit

yarn test:unit ./path-to-test-file




yarn lint

yarn lint:js
yarn lint:sass



Unit Tests

  • New code added to vets-website should be unit tested.

  • Updated code should pass or adjust existing unit tests.

  • Unit tests should cover at least 75% of code paths.

Unit Testing Guidelines

Unit tests

End-to-End Tests

  • Applications should have end-to-end tests.

  • Applications that are built with the VA Forms Library should be tested with the form tester.

  • These tests validate multi-page applications with client-side routing. They are primarily used to assert that:

    • Client applications render their inputs

    • Client-side navigation occurs when the required fields are populated

  • See the Client Application Documentation site for conventions and tooling used for end to end tests.

Accessibility Tests

  • Client applications must include accessibility tests in their end-to-end suite.

    • Pull requests without accessibility test coverage will not be accepted.

    • These tests should be run on all client-side routes and critical user interactions.

    • Use the Cypress custom command cy.axeCheck() to run an accessibility check.

  • Tests written with the form tester will automatically test accessibility.

    • No explicit accessibility testing is required with such tests.

    • On every page, accessibility is checked once upon navigating to that page and again after filling out the page (or running its page hook) and expanding all expandable content.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.