@ariestools/vitest-config
v10.0.6
Published
Shared Vitest helpers for Aries Tools (node + optional Chromium projects)
Readme
@ariestools/vitest-config
Shared Vitest helpers for Aries Tools (node + optional Chromium projects)
Install
Requires Node.js ≥ 22. pnpm is fully supported; npm / yarn / bun are experimental.
pnpm add -D @ariestools/vitest-configPeer: vitest ^4.1. The Playwright browser provider is not bundled — install @vitest/browser-playwright in the consuming repo if you enable browser.
Usage
Default include is the monorepo glob packages/*/src/**/spec/**/*.spec.ts. Spec placement routes the environment: spec/ runs in both realms, spec/node/ is Node-only, spec/browser/ is headless Chromium.
A single-package repo must pass include (for example ['src/**/spec/**/*.spec.ts']).
import { defineXyVitestConfig } from '@ariestools/vitest-config'
import { playwright } from '@vitest/browser-playwright'
export default defineXyVitestConfig({ browser: { provider: playwright() } })Repos without browser specs omit browser:
import { defineXyVitestConfig } from '@ariestools/vitest-config'
export default defineXyVitestConfig()Serialized e2e suites are extra projects:
import { defineXySerializedProject, defineXyVitestConfig } from '@ariestools/vitest-config'
import { playwright } from '@vitest/browser-playwright'
export default defineXyVitestConfig({
browser: { provider: playwright() },
exclude: ['**/spec/**/sequence/**'],
projects: [
defineXySerializedProject({
include: ['packages/e2e/src/**/spec/sequence/**/*.spec.ts'],
name: 'sequence',
testTimeout: 900_000,
}),
],
})defineXyVitestConfig accepts:
| Option | Default | Description |
|--------|---------|-------------|
| include | ['packages/*/src/**/spec/**/*.spec.ts'] | Spec globs shared by the node and browser projects |
| exclude | [] | Extra excludes appended to both realm projects |
| browser | omitted | Browser project options (provider required); omit or false to skip |
| node | {} | Node project options; false to skip |
| projects | [] | Extra projects appended verbatim |
| test | { watch: false } | Top-level test options merged over the defaults |
defineXyVitestProjects returns just the projects array. defineXySerializedProject builds a single-file-at-a-time Node project (hookTimeout: 180_000, testTimeout: 240_000).
License
LGPL-3.0-only. See LICENSE (LGPLv3) and COPYING (GPLv3, incorporated by LGPL-3).
