Skip to content

Checks & tests ​

Every package has the same commands:

CommandWhat it does
yarn format:checkChecks formatting with Prettier
yarn format:writeFormats every file in the package. Changes files
yarn check:tsType checks
yarn testRuns the package's tests
yarn readyFormats, type checks and tests: what CI will check

CI runs the checks for each package a merge request touches, and every check before anything is released. Before pushing, run the checks for what you changed, with the SDK built and synced first:

sh
yarn --cwd sdk check:ts && yarn --cwd sdk test
yarn --cwd backend check:ts && yarn --cwd backend test
yarn --cwd frontend check:ts && yarn --cwd frontend build
yarn --cwd mobile check:ts && yarn --cwd mobile check:bundle

Backend tests ​

yarn test runs the Mocha suite against an in-memory SQLite database, rebuilt before each test, so tests run one at a time. It stops at the first failure; yarn test:all doesn't.

The tests need Redis, and empty it before every test. Point them at a database of their own so they never wipe your development data:

sh
REDIS_URL=redis://localhost:6669/15 yarn --cwd backend test

Run one file with yarn mocha tests/api/channel.test.ts, or filter with yarn test --grep "pattern".

Web app tests ​

CommandWhat it runs
yarn test:unitUnit tests in tests/unit/, with Node's built-in test runner
yarn testPlaywright end-to-end tests against a real backend, started with a fresh E2E database
yarn test:regressionPlaywright tests of the real components against a mocked server. Doesn't touch your development data

Set PLAYWRIGHT_CHANNEL=chrome to use your installed Chrome instead of Playwright's browsers.

Code style ​

Prettier, in every package: double quotes, semicolons, trailing commas, 120-character lines and 2-space indents. Comments explain why, not what; match the density of the code around them.

Released under the GNU Affero General Public License v3.0.