In effort to maintain a stable application Thunderdome is supported by automated testing
Cypress is used for End to End testing of Thunderdome, keep tests atomic!
cd e2e
npm install
npm run cypress:open
- Follow cypress best practices
- Favor adding
data-testid"
attribute to dom elements for selection, never use css classes- custom cypress command
cy.getByTestId()
exists to select dom elements simply by passing thedata-testid
attribute value e.g.cy.getByTestId('user-delete')
would look fordata-testid="user-delete"
- custom cypress command
Frontend unit tests are run with Jest and utilize @testing-library/svelte.
To run the tests npm test
for a single run or npm test:watch
to actively watch for test changes.
- Check out Unit testing svelte component guide
- Test files are named
{componentName}.test.js
- Test folders are named
__tests__
and live alongside the source code to which the test files are for- Example
frontend/src/pages/__tests__/*.test.js
corresponds tofrontend/src/pages/*.svelte
- Example
- Snapshot testing should only be used for individual components not page components
Run make testgo
to run go tests