Skip to content

Testing & CI

Orchard has a series of tests to ensure the codebase is formatted and functions as expected:

  • Unit tests for both the server and the client.
  • Formatting and linting.
  • CI pipeline that runs the same checks on every pull request.

Run everything at once:

Terminal window
npm run test

This runs the server tests, then the client tests. You can also run each side on its own.

Server tests use Jest. Specs live next to the code they cover, as *.spec.ts files under src/server.

CommandWhat it does
npm run test:serverRun the server tests once.
npm run test:server:watchRe-run on change.
npm run test:server:covRun with a coverage report.
npm run test:debugRun with the Node inspector attached.

Client tests use Karma with Jasmine, run in headless Chrome. Specs are *.spec.ts files under src/client.

Terminal window
npm run test:client
Terminal window
npm run format # format with Prettier
npm run format:check # check formatting without writing changes
npm run lint # lint with ESLint
npm run lint:fix # lint and auto-fix

CI runs format:check and lint, so run them before pushing.

CI is a GitHub Actions workflow at .github/workflows/ci.yml. It runs on every push and pull request to master, and can also be triggered manually. There is one job, quality-check, on ubuntu-latest, which runs these steps in order:

  1. Install dependencies with npm ci.
  2. Install Chrome (for the client tests).
  3. npm run format:check
  4. npm run lint
  5. npm run generate:types
  6. npm run test
  7. npm run build
  8. Upload the built dist as an artifact.

The Node version comes from .nvmrc. Running format:check, lint, and test locally before you push mirrors what CI checks.

Two more workflows build Docker images rather than run tests:

WorkflowTriggerWhat it does
image-release.ymlA published GitHub releaseBuilds and pushes multi-architecture images to the GitHub Container Registry.
image-snapshot.ymlManual dispatchBuilds snapshot images on demand.

Development Testing & CI

Last updated: