{"owner":"vitest-dev","repo":"vitest","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md"],"skills":{"AGENTS.md":"# Vitest AI Agent Guide\n\nThis document provides comprehensive information for AI agents working on the Vitest codebase.\n\n## Project Overview\n\nVitest is a next-generation testing framework powered by Vite. This is a monorepo using pnpm workspaces with the following key characteristics:\n\n- **Language**: TypeScript/JavaScript (ESM-first)\n- **Package Manager**: pnpm (required)\n- **Node Version**: ^20.0.0 || ^22.0.0 || >=24.0.0\n- **Build System**: Vite + Rollup\n- **Monorepo Structure**: 15+ packages in `packages/` directory\n\n## Setup and Development\n\n### Initial Setup\n1. Run `pnpm install` to install dependencies\n2. Run `pnpm build` to build all packages\n3. Install Playwright browsers when working with browser features: `npx playwright install --with-deps`\n\n### Key Scripts\n- `pnpm build` - Build all packages\n- `pnpm dev` - Watch mode for development\n- `pnpm lint` - Run ESLint\n- `pnpm lint:fix` - Fix linting issues automatically\n- `pnpm typecheck` - Run TypeScript type checking\n\n## Testing\n\n### Running Tests\n- **All tests**: `CI=true pnpm test:ci`\n- **Examples**: `CI=true pnpm test:examples`\n- **Specific test suite**: `CI=true cd test/<test-folder> && pnpm test <test-file>`\n- **Unit directory test**: `CI=true pnpm test <test-file>` (for `test/unit`)\n- **Browser tests**: `CI=true pnpm test:browser:playwright`\n\n**IMPORTANT: Do NOT use `--` when passing test filters to pnpm.**\nUsing `--` causes pnpm to drop the filter, resulting in a full test run instead of a filtered one.\n\n```bash\n# WRONG - runs ALL tests (filter is ignored):\npnpm test -- basic.test.ts -t 'expect'\n\n# CORRECT - runs only matching tests:\npnpm test basic.test.ts -t 'expect'\n```\n\nWhen writing tests, AVOID using `toContain` for validation. Prefer using `toMatchInlineSnapshot` to include the test error and its stack. If snapshot is failing, update the snapshot instead of reverting it to `toContain`.\n\nIf you need to typecheck tests, run `pnpm typecheck` from the root of the workspace.\n\n### Rebuilding Package Changes\n\nTests can execute built output from `packages/*/dist`. After changing package source, rebuild the changed package and every consumer that bundles it before verifying the change; otherwise tests may execute stale code. For example, rebuild both packages when testing an `@vitest/utils` change through Vitest e2e tests:\n\n```bash\npnpm --filter @vitest/utils build\npnpm --filter vitest build\n```\n\n### Testing Utilities\n- **`runInlineTests`** from `test/test-utils/index.ts` - You must use this for complex file system setups (>1 file)\n- **`runVitest`** from `test/test-utils/index.ts` - You can use this to run Vitest programmatically\n- **No mocking policy** - You must never mock anything in tests\n\n## Project Structure\n\n### Core Packages (`packages/`)\n- `vitest` - Main testing framework\n- `browser` - Browser testing support\n- `ui` - Web UI for test results\n- `runner` - Test runner core\n- `expect` - Assertion library\n- `spy` - Mocking and spying utilities\n- `snapshot` - Snapshot testing\n- `coverage-v8` / `coverage-istanbul` - Code coverage\n- `utils` - Shared utilities\n- `mocker` - Module mocking\n\n### Test Organization (`test/`)\n- `test/unit` - Core functionality tests\n- `test/browser` - Browser-specific tests\n- Various test suites organized by feature\n\n### Important Directories\n- `docs/` - Documentation (Vite-powered)\n- `examples/` - Example projects and integrations\n- `scripts/` - Build and development scripts\n- `.github/` - GitHub Actions workflows\n- `patches/` - Package patches via pnpm\n\n## Code Style and Conventions\n\n### Formatting and Linting\n- **Always run** `pnpm lint:fix` after making changes\n- Fix non-auto-fixable errors manually\n\n### TypeScript\n- Strict TypeScript configuration\n- Use `pnpm typecheck` to verify types\n- Configuration files: `tsconfig.base.json`, `tsconfig.build.json`, `tsconfig.check.json`\n\n### Code Quality\n- ESM-first approach\n- Follow existing patterns in the codebase\n- Use utilities from `@vitest/utils/*` when available. Never import from `@vitest/utils` main entry point directly.\n- Do not add comments explaining what the line does unless prompted to.\n\n## Common Workflows\n\n### Adding New Features\n1. Identify the appropriate package in `packages/`\n2. Follow existing code patterns\n3. Add tests using testing utilities\n4. Run `pnpm build && pnpm typecheck && pnpm lint:fix`\n5. Add tests with relevant test suites\n\n### Debugging\n- Use VS Code: `⇧⌘B` (Shift+Cmd+B) or `Ctrl+Shift+B` for dev tasks\n- Check `scripts/` directory for specialized development tools\n\n### Documentation\n- Main docs in `docs/` directory\n- Built with `pnpm docs:build`\n- Local dev server: `pnpm docs`\n- When adding cli options, run `pnpm -C docs run cli-table` to update the cli-generated.md file\n\n## Dependencies and Tools\n\n### Key Dependencies\n- **Vite** - Build tool and dev server\n- **Rollup** - Bundler\n- **ESLint** - Linting\n- **TypeScript** - Type checking\n- **Playwright** - Browser testing\n- **Chai/Expect** - Assertions\n- **Tinypool** - Worker threading\n- **Tinybench** - Benchmarking\n\n### Development Tools\n- **tsx** - TypeScript execution\n- **ni/nr** - Package manager abstraction\n- **bumpp** - Version bumping\n- **changelogithub** - Changelog generation\n\n## Browser Testing\n- Two modes: Playwright and WebDriverIO\n- Separate test commands for each\n- Component testing supported (Vue, React, Svelte, Lit, Marko)\n\n## Performance Considerations\n- This is a performance-critical testing framework\n- Pay attention to import costs and bundle size\n- Use lazy loading where appropriate\n- Consider worker thread implications\n\n## Troubleshooting\n\n### Common Issues\n- Ensure pnpm is used (not npm/yarn)\n- Build before running tests\n- Check Node.js version compatibility\n- Playwright browsers must be installed for browser tests\n\n### Getting Help\n- Check existing issues and documentation\n- Review CONTRIBUTING.md for detailed guidelines\n- Follow patterns in existing code\n\n## PR Descriptions\n\nWhen creating a pull request, you MUST include the following HTML comment at the bottom of the PR description:\n\n```\n<!-- VITEST_AUTOMATED_PR -->\n```\n\nThis allows maintainers to identify AI-assisted PRs for triage. PRs containing this marker will be automatically labeled `maybe automated` and will be closed in 3 days unless a real person confirms ownership.\n"},"files":{"AGENTS.md":"# Vitest AI Agent Guide\n\nThis document provides comprehensive information for AI agents working on the Vitest codebase.\n\n## Project Overview\n\nVitest is a next-generation testing framework powered by Vite. This is a monorepo using pnpm workspaces with the following key characteristics:\n\n- **Language**: TypeScript/JavaScript (ESM-first)\n- **Package Manager**: pnpm (required)\n- **Node Version**: ^20.0.0 || ^22.0.0 || >=24.0.0\n- **Build System**: Vite + Rollup\n- **Monorepo Structure**: 15+ packages in `packages/` directory\n\n## Setup and Development\n\n### Initial Setup\n1. Run `pnpm install` to install dependencies\n2. Run `pnpm build` to build all packages\n3. Install Playwright browsers when working with browser features: `npx playwright install --with-deps`\n\n### Key Scripts\n- `pnpm build` - Build all packages\n- `pnpm dev` - Watch mode for development\n- `pnpm lint` - Run ESLint\n- `pnpm lint:fix` - Fix linting issues automatically\n- `pnpm typecheck` - Run TypeScript type checking\n\n## Testing\n\n### Running Tests\n- **All tests**: `CI=true pnpm test:ci`\n- **Examples**: `CI=true pnpm test:examples`\n- **Specific test suite**: `CI=true cd test/<test-folder> && pnpm test <test-file>`\n- **Unit directory test**: `CI=true pnpm test <test-file>` (for `test/unit`)\n- **Browser tests**: `CI=true pnpm test:browser:playwright`\n\n**IMPORTANT: Do NOT use `--` when passing test filters to pnpm.**\nUsing `--` causes pnpm to drop the filter, resulting in a full test run instead of a filtered one.\n\n```bash\n# WRONG - runs ALL tests (filter is ignored):\npnpm test -- basic.test.ts -t 'expect'\n\n# CORRECT - runs only matching tests:\npnpm test basic.test.ts -t 'expect'\n```\n\nWhen writing tests, AVOID using `toContain` for validation. Prefer using `toMatchInlineSnapshot` to include the test error and its stack. If snapshot is failing, update the snapshot instead of reverting it to `toContain`.\n\nIf you need to typecheck tests, run `pnpm typecheck` from the root of the workspace.\n\n### Rebuilding Package Changes\n\nTests can execute built output from `packages/*/dist`. After changing package source, rebuild the changed package and every consumer that bundles it before verifying the change; otherwise tests may execute stale code. For example, rebuild both packages when testing an `@vitest/utils` change through Vitest e2e tests:\n\n```bash\npnpm --filter @vitest/utils build\npnpm --filter vitest build\n```\n\n### Testing Utilities\n- **`runInlineTests`** from `test/test-utils/index.ts` - You must use this for complex file system setups (>1 file)\n- **`runVitest`** from `test/test-utils/index.ts` - You can use this to run Vitest programmatically\n- **No mocking policy** - You must never mock anything in tests\n\n## Project Structure\n\n### Core Packages (`packages/`)\n- `vitest` - Main testing framework\n- `browser` - Browser testing support\n- `ui` - Web UI for test results\n- `runner` - Test runner core\n- `expect` - Assertion library\n- `spy` - Mocking and spying utilities\n- `snapshot` - Snapshot testing\n- `coverage-v8` / `coverage-istanbul` - Code coverage\n- `utils` - Shared utilities\n- `mocker` - Module mocking\n\n### Test Organization (`test/`)\n- `test/unit` - Core functionality tests\n- `test/browser` - Browser-specific tests\n- Various test suites organized by feature\n\n### Important Directories\n- `docs/` - Documentation (Vite-powered)\n- `examples/` - Example projects and integrations\n- `scripts/` - Build and development scripts\n- `.github/` - GitHub Actions workflows\n- `patches/` - Package patches via pnpm\n\n## Code Style and Conventions\n\n### Formatting and Linting\n- **Always run** `pnpm lint:fix` after making changes\n- Fix non-auto-fixable errors manually\n\n### TypeScript\n- Strict TypeScript configuration\n- Use `pnpm typecheck` to verify types\n- Configuration files: `tsconfig.base.json`, `tsconfig.build.json`, `tsconfig.check.json`\n\n### Code Quality\n- ESM-first approach\n- Follow existing patterns in the codebase\n- Use utilities from `@vitest/utils/*` when available. Never import from `@vitest/utils` main entry point directly.\n- Do not add comments explaining what the line does unless prompted to.\n\n## Common Workflows\n\n### Adding New Features\n1. Identify the appropriate package in `packages/`\n2. Follow existing code patterns\n3. Add tests using testing utilities\n4. Run `pnpm build && pnpm typecheck && pnpm lint:fix`\n5. Add tests with relevant test suites\n\n### Debugging\n- Use VS Code: `⇧⌘B` (Shift+Cmd+B) or `Ctrl+Shift+B` for dev tasks\n- Check `scripts/` directory for specialized development tools\n\n### Documentation\n- Main docs in `docs/` directory\n- Built with `pnpm docs:build`\n- Local dev server: `pnpm docs`\n- When adding cli options, run `pnpm -C docs run cli-table` to update the cli-generated.md file\n\n## Dependencies and Tools\n\n### Key Dependencies\n- **Vite** - Build tool and dev server\n- **Rollup** - Bundler\n- **ESLint** - Linting\n- **TypeScript** - Type checking\n- **Playwright** - Browser testing\n- **Chai/Expect** - Assertions\n- **Tinypool** - Worker threading\n- **Tinybench** - Benchmarking\n\n### Development Tools\n- **tsx** - TypeScript execution\n- **ni/nr** - Package manager abstraction\n- **bumpp** - Version bumping\n- **changelogithub** - Changelog generation\n\n## Browser Testing\n- Two modes: Playwright and WebDriverIO\n- Separate test commands for each\n- Component testing supported (Vue, React, Svelte, Lit, Marko)\n\n## Performance Considerations\n- This is a performance-critical testing framework\n- Pay attention to import costs and bundle size\n- Use lazy loading where appropriate\n- Consider worker thread implications\n\n## Troubleshooting\n\n### Common Issues\n- Ensure pnpm is used (not npm/yarn)\n- Build before running tests\n- Check Node.js version compatibility\n- Playwright browsers must be installed for browser tests\n\n### Getting Help\n- Check existing issues and documentation\n- Review CONTRIBUTING.md for detailed guidelines\n- Follow patterns in existing code\n\n## PR Descriptions\n\nWhen creating a pull request, you MUST include the following HTML comment at the bottom of the PR description:\n\n```\n<!-- VITEST_AUTOMATED_PR -->\n```\n\nThis allows maintainers to identify AI-assisted PRs for triage. PRs containing this marker will be automatically labeled `maybe automated` and will be closed in 3 days unless a real person confirms ownership.\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","title":"AGENTS.md","content":"# Vitest AI Agent Guide\n\nThis document provides comprehensive information for AI agents working on the Vitest codebase.\n\n## Project Overview\n\nVitest is a next-generation testing framework powered by Vite. This is a monorepo using pnpm workspaces with the following key characteristics:\n\n- **Language**: TypeScript/JavaScript (ESM-first)\n- **Package Manager**: pnpm (required)\n- **Node Version**: ^20.0.0 || ^22.0.0 || >=24.0.0\n- **Build System**: Vite + Rollup\n- **Monorepo Structure**: 15+ packages in `packages/` directory\n\n## Setup and Development\n\n### Initial Setup\n1. Run `pnpm install` to install dependencies\n2. Run `pnpm build` to build all packages\n3. Install Playwright browsers when working with browser features: `npx playwright install --with-deps`\n\n### Key Scripts\n- `pnpm build` - Build all packages\n- `pnpm dev` - Watch mode for development\n- `pnpm lint` - Run ESLint\n- `pnpm lint:fix` - Fix linting issues automatically\n- `pnpm typecheck` - Run TypeScript type checking\n\n## Testing\n\n### Running Tests\n- **All tests**: `CI=true pnpm test:ci`\n- **Examples**: `CI=true pnpm test:examples`\n- **Specific test suite**: `CI=true cd test/<test-folder> && pnpm test <test-file>`\n- **Unit directory test**: `CI=true pnpm test <test-file>` (for `test/unit`)\n- **Browser tests**: `CI=true pnpm test:browser:playwright`\n\n**IMPORTANT: Do NOT use `--` when passing test filters to pnpm.**\nUsing `--` causes pnpm to drop the filter, resulting in a full test run instead of a filtered one.\n\n```bash\n# WRONG - runs ALL tests (filter is ignored):\npnpm test -- basic.test.ts -t 'expect'\n\n# CORRECT - runs only matching tests:\npnpm test basic.test.ts -t 'expect'\n```\n\nWhen writing tests, AVOID using `toContain` for validation. Prefer using `toMatchInlineSnapshot` to include the test error and its stack. If snapshot is failing, update the snapshot instead of reverting it to `toContain`.\n\nIf you need to typecheck tests, run `pnpm typecheck` from the root of the workspace.\n\n### Rebuilding Package Changes\n\nTests can execute built output from `packages/*/dist`. After changing package source, rebuild the changed package and every consumer that bundles it before verifying the change; otherwise tests may execute stale code. For example, rebuild both packages when testing an `@vitest/utils` change through Vitest e2e tests:\n\n```bash\npnpm --filter @vitest/utils build\npnpm --filter vitest build\n```\n\n### Testing Utilities\n- **`runInlineTests`** from `test/test-utils/index.ts` - You must use this for complex file system setups (>1 file)\n- **`runVitest`** from `test/test-utils/index.ts` - You can use this to run Vitest programmatically\n- **No mocking policy** - You must never mock anything in tests\n\n## Project Structure\n\n### Core Packages (`packages/`)\n- `vitest` - Main testing framework\n- `browser` - Browser testing support\n- `ui` - Web UI for test results\n- `runner` - Test runner core\n- `expect` - Assertion library\n- `spy` - Mocking and spying utilities\n- `snapshot` - Snapshot testing\n- `coverage-v8` / `coverage-istanbul` - Code coverage\n- `utils` - Shared utilities\n- `mocker` - Module mocking\n\n### Test Organization (`test/`)\n- `test/unit` - Core functionality tests\n- `test/browser` - Browser-specific tests\n- Various test suites organized by feature\n\n### Important Directories\n- `docs/` - Documentation (Vite-powered)\n- `examples/` - Example projects and integrations\n- `scripts/` - Build and development scripts\n- `.github/` - GitHub Actions workflows\n- `patches/` - Package patches via pnpm\n\n## Code Style and Conventions\n\n### Formatting and Linting\n- **Always run** `pnpm lint:fix` after making changes\n- Fix non-auto-fixable errors manually\n\n### TypeScript\n- Strict TypeScript configuration\n- Use `pnpm typecheck` to verify types\n- Configuration files: `tsconfig.base.json`, `tsconfig.build.json`, `tsconfig.check.json`\n\n### Code Quality\n- ESM-first approach\n- Follow existing patterns in the codebase\n- Use utilities from `@vitest/utils/*` when available. Never import from `@vitest/utils` main entry point directly.\n- Do not add comments explaining what the line does unless prompted to.\n\n## Common Workflows\n\n### Adding New Features\n1. Identify the appropriate package in `packages/`\n2. Follow existing code patterns\n3. Add tests using testing utilities\n4. Run `pnpm build && pnpm typecheck && pnpm lint:fix`\n5. Add tests with relevant test suites\n\n### Debugging\n- Use VS Code: `⇧⌘B` (Shift+Cmd+B) or `Ctrl+Shift+B` for dev tasks\n- Check `scripts/` directory for specialized development tools\n\n### Documentation\n- Main docs in `docs/` directory\n- Built with `pnpm docs:build`\n- Local dev server: `pnpm docs`\n- When adding cli options, run `pnpm -C docs run cli-table` to update the cli-generated.md file\n\n## Dependencies and Tools\n\n### Key Dependencies\n- **Vite** - Build tool and dev server\n- **Rollup** - Bundler\n- **ESLint** - Linting\n- **TypeScript** - Type checking\n- **Playwright** - Browser testing\n- **Chai/Expect** - Assertions\n- **Tinypool** - Worker threading\n- **Tinybench** - Benchmarking\n\n### Development Tools\n- **tsx** - TypeScript execution\n- **ni/nr** - Package manager abstraction\n- **bumpp** - Version bumping\n- **changelogithub** - Changelog generation\n\n## Browser Testing\n- Two modes: Playwright and WebDriverIO\n- Separate test commands for each\n- Component testing supported (Vue, React, Svelte, Lit, Marko)\n\n## Performance Considerations\n- This is a performance-critical testing framework\n- Pay attention to import costs and bundle size\n- Use lazy loading where appropriate\n- Consider worker thread implications\n\n## Troubleshooting\n\n### Common Issues\n- Ensure pnpm is used (not npm/yarn)\n- Build before running tests\n- Check Node.js version compatibility\n- Playwright browsers must be installed for browser tests\n\n### Getting Help\n- Check existing issues and documentation\n- Review CONTRIBUTING.md for detailed guidelines\n- Follow patterns in existing code\n\n## PR Descriptions\n\nWhen creating a pull request, you MUST include the following HTML comment at the bottom of the PR description:\n\n```\n<!-- VITEST_AUTOMATED_PR -->\n```\n\nThis allows maintainers to identify AI-assisted PRs for triage. PRs containing this marker will be automatically labeled `maybe automated` and will be closed in 3 days unless a real person confirms ownership.\n","category":"root","tokens":1571}]}