Skip to main content
@quiesco/jest is a Jest preset. Tests reach the app through the global quiesco, like Jest’s own test and expect. It needs Jest 30 or later.

Setup

quiesco init --runner jest installs @quiesco/jest and jest, and writes two files:
If the project already has a Jest config for its unit tests (jest.config.*, or "jest" in package.json), init writes Quiesco’s config to jest.e2e.config.cjs instead, and the e2e:* scripts pass --config jest.e2e.config.cjs.

The preset

preset: '@quiesco/jest' sets three things:

What your config sets

A preset cannot set these two, so your config does:
number
required
1 runs the files one at a time. N runs them on N devices in parallel, one per worker process (parallel runs). --maxWorkers N on the command line overrides it.
number
required
Timeout of each test, in ms. Each Quiesco call waits for the app to become idle, so leave room for that, e.g. 120_000.
transform: {} turns off Babel, so plain JavaScript test files run as they are.

Your own reporters or teardown

Jest replaces a preset’s option with the config’s instead of merging them:
  • reporters: add '@quiesco/jest/reporter' to your list, next to 'default'. Without it, the tests still run, but quiesco test shows no progress.
  • globalTeardown: call Quiesco’s from yours, or devices and apps are left running:

Writing tests

  • quiesco.app: the Driver.
  • quiesco.session: the session, for what the Driver does not cover.
Before each test, the app is reset. After a failed test, the evidence (screenshot, element tree, idle state, logs) is written to the artifacts directory and listed in the failure message. Jest has no test options, so platform tags go in the test or describe title:
For TypeScript, add the type of the quiesco global to tsconfig.json:

Running

quiesco test sets QUIESCO_PLATFORM and runs jest; other arguments go to Jest (quiesco test). Running npx jest yourself also works with QUIESCO_PLATFORM set, but then Metro is not started for you.