@quiesco/vitest is the recommended runner. Tests are TypeScript, and they reach the app through the app
fixture. It needs Vitest 5.1 or later.
Setup
quiesco init --runner vitest installs @quiesco/vitest and vitest, and writes two files:
vitest.config.* for its unit tests, init writes Quiesco’s config to
vitest.e2e.config.mts instead, and the e2e:* scripts pass --config vitest.e2e.config.mts.
quiesco()
QuiescoVitestOptions · QuiescoTestConfig
quiesco() returns the test options Quiesco needs. Spread it into test and add your own options after
it.
How many workers run test files in parallel, each on a device of its own (parallel runs).
1 runs the files one at a time.Timeout of each test and hook, in ms. The first test also waits for the session to start, and booting a
device can take minutes.
The tag names, when
quiesco.config.mts renames them with tags. Pass the same object
here.Tags of your own to declare, e.g.
['@smoke']. Vitest only accepts declared tags; the platform and
browser tags are declared already.--fileParallelism --maxWorkers N on the command line overrides workers.
quiescoPlugin()
QuiescoVitestPlugin
Sends the run’s progress to the progress bar of quiesco test and to quiesco ui. It adds its
reporter only when one of them runs Vitest, next to your own reporters. Without it, the tests still run,
and quiesco test prints a hint at the end.
Hooks for every file
Because ofisolate: false, test files share their modules. A support module imported by every file runs
only once per worker, so a test.beforeEach(…) at its top level is registered for the first file that
imports it, and the other files run without it, silently. Register such hooks in each test file, or in a
setup file, which Vitest runs before every file:
globalSetup
(see the example app).
Writing tests
Importtest (or it), describe and expect from @quiesco/vitest. Two fixtures reach the app:
app: the Driver.session: the session, for what the Driver does not cover (session.platform, …).
describe title, or in the test’s tags option:
Running
quiesco test sets QUIESCO_PLATFORM and runs vitest run; other arguments go to Vitest
(quiesco test). Running npx vitest run yourself also works with
QUIESCO_PLATFORM set, but then Metro is not started for you.