@tracera/vitest
v1.3.1
Published
Vitest reporter and runtime for Tracera autotest
Maintainers
Readme
@tracera/vitest
Vitest reporter and runtime for Tracera autotest.
Requires Node.js ≥ 22.19 and Vitest ≥ 2.
npm install @tracera/vitestHow-to: Vitest. Shared env / run mode: Autotest adapters.
Setup
import { defineConfig } from 'vitest/config';
import { tracera } from '@tracera/vitest/plugin';
export default defineConfig({
plugins: [tracera()],
});The plugin wires the runner, setup, and reporter. Manual test.runner / setupFiles / reporters still work.
Bind
Import test / expect from vitest, and tracera / annotations from this package. Prefer { meta: annotations(id, name) } (the name is literal); or tracera.testCase in the body. For test.each / test.for placeholders, wrap the body — see Parameterized.
Skip
Stock Vitest skip (test.skip, or skip(reason) from the test context). The reason becomes a result comment.
Steps
tracera.step(title, fn), @tracera.step("open {path}") on class methods, or tracera.step("…")(fn) wrap ({name} / {0} from args, or a title function). Stock beforeEach / afterEach → Setup / Teardown; beforeAll / afterAll are not reported.
Comments, errors, and attachments
tracera.comment / tracera.error / tracera.attachment — see Autotest adapters.
Parameterized
With test.each / test.for, wrap the body: annotations(id, 'login as {login}', fn) so placeholders expand from the row. Optional {param_id} is the Vitest test name for that row. Retries: final attempt only; VITEST_RETRY on Env when retry > 0.
