@robit-one/reporter
v0.1.23
Published
Test reporter adapters for [robit.one](https://robit.one) — automatically post test results to your Robit dashboard from vitest, Playwright, or Deno.
Readme
@robit-one/reporter
Test reporter adapters for robit.one — automatically post test results to your Robit dashboard from vitest, Playwright, or Deno.
Part of the robit.one monorepo.
Installation
npm install @robit-one/reporterUsage
Vitest
In vitest.config.ts:
import { defineConfig } from 'vitest/config'
import { RobitReporter } from '@robit-one/reporter/vitest'
export default defineConfig({
test: {
reporters: [
'default',
new RobitReporter({
token: process.env.ROBIT_TOKEN,
suite: 'unit',
}),
],
},
})Playwright
In playwright.config.ts:
import { defineConfig } from '@playwright/test'
export default defineConfig({
reporter: [
['list'],
['@robit-one/reporter/playwright', {
token: process.env.ROBIT_TOKEN,
suite: 'e2e',
}],
],
})Deno
The Deno integration is a runner script that wraps deno test, captures results, and posts them to Robit. Install from JSR and invoke it in place of deno test:
deno run -A jsr:@robit-one/reporter/run --suite=unit -- src/Pass the token inline or via environment variable:
# inline flag
deno run -A jsr:@robit-one/reporter/run --suite=unit --token=rbt_xxx -- src/
# or via env var (useful in CI)
ROBIT_TOKEN=rbt_xxx deno run -A jsr:@robit-one/reporter/run --suite=unit -- src/The runner automatically collects coverage via deno coverage --lcov and posts it alongside your results. All arguments after -- are forwarded to deno test.
Configuration
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| token | string | required | Your Robit project token |
| suite | string | required | Test suite name (e.g. 'unit', 'e2e', 'integration') |
| runner | 'vitest' \| 'playwright' \| 'deno' \| 'unknown' | auto-set by adapter | Override the runner type sent to Robit |
| environment | string | auto-detected | Environment name (ci, staging, etc.) |
| branch | string | auto-detected | Git branch name |
| baseUrl | string | https://app.robit.one | Custom Robit instance URL |
| enabled | boolean | true | Set to false to disable reporting without removing config |
| meta | Record<string, unknown> | undefined | Custom metadata attached to the run |
| timeoutMs | number | 10000 | Fetch timeout in milliseconds |
Environment detection
Branch, environment, and commit info are auto-detected from CI environment variables with git fallbacks.
Branch is read from (in order): config.branch → GITHUB_REF_NAME → BITBUCKET_BRANCH → CI_COMMIT_BRANCH → git rev-parse --abbrev-ref HEAD
Environment is read from: config.environment → NODE_ENV → APP_ENV → ENVIRONMENT
Commit SHA is read from: GITHUB_SHA → BITBUCKET_COMMIT → CI_COMMIT_SHA → git rev-parse HEAD
Supported CI providers: GitHub Actions, Bitbucket Pipelines, GitLab CI.
