@xats-org/vitest-config
v0.5.0
Published
Shared Vitest configuration for xats monorepo
Readme
@xats-org/vitest-config
Shared Vitest configuration for the xats monorepo.
Usage
Install the package:
pnpm add -D @xats-org/vitest-config vitestCreate a vitest.config.ts file in your package:
import { createVitestConfig } from '@xats-org/vitest-config';
export default createVitestConfig({
// Custom options here
});Or for simpler usage:
import vitestConfig from '@xats-org/vitest-config';
export default vitestConfig();Features
- TypeScript support out of the box
- Coverage reporting with v8
- Global test utilities
- Mock restoration between tests
- Optimized for monorepo usage
- Consistent test patterns across packages
Configuration Options
The createVitestConfig function accepts all standard Vitest options plus:
root: Custom root directory (defaults to current working directory)
Scripts
Add these scripts to your package.json:
{
"scripts": {
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage"
}
}License
MIT
