vitest

Warn

Audited by Runlayer on Feb 21, 2026

Risk Level: MEDIUM
Scan Summary
Max Score
78%
Files
18
Flagged
12
Chunks
18
Flagged Files (12)
references/advanced-environments.mdHIGH
78.3%

Malicious tool definition detected

Tool: references/advanced-environments.md Description: --- name: test-environments description: Configure environments like jsdom, happy-dom for browser APIs --- # Test Environments ## Available Environments - `node` (default) - Node.js environment - `jsdom` - Browser-like with DOM APIs - `happy-dom` - Faster alternative to jsdom - `edge-runtime` - Vercel Edge Runtime ## Configuration ```ts // vitest.config.ts defineConfig({ test: { environment: 'jsdom', // Environment-specific options environme

references/advanced-projects.mdHIGH
78.3%

Malicious tool definition detected

## Basic Projects Setup ```ts // vitest.config.ts defineConfig({ test: { projects: [ // Glob patterns for config files 'packages/*', // Inline config { test: { name: 'unit', include: ['tests/unit/**/*.test.ts'], environment: 'node', }, }, { test: { name: 'integration', include: ['tests/integration/**/*.test.ts'], environment: 'jsdom', }, }, ], }, }) ``` ## Monorepo Pattern ```ts defineConfig({ test: { projects: [ // Each package has its own vitest.config.ts 'packages/core', 'packages/cli', 'pack

references/advanced-type-testing.mdHIGH
78.3%

Malicious tool definition detected

Tool: references/advanced-type-testing.md Description: --- name: type-testing description: Test TypeScript types with expectTypeOf and assertType --- # Type Testing Test TypeScript types without runtime execution.

references/core-cli.mdHIGH
78.3%

Malicious tool definition detected

Tool: references/core-cli.md Description: --- name: vitest-cli description: Command line interface commands and options --- # Command Line Interface ## Commands ### `vitest` Start Vitest in watch mode (dev) or run mode (CI): ```bash vitest # Watch mode in dev, run mode in CI vitest foobar # Run tests containing "foobar" in path vitest basic/foo.test.ts:10 # Run specific test by file and line number ``` ### `vitest run` Run tests once without watch mode: ```bash vi

references/core-config.mdHIGH
78.3%

Malicious tool definition detected

Tool: references/core-config.md Description: --- name: vitest-configuration description: Configure Vitest with vite.config.ts or vitest.config.ts --- # Configuration Vitest reads configuration from `vitest.config.ts` or `vite.config.ts`.

references/core-expect.mdHIGH
78.3%

Malicious tool definition detected

name: expect.any(String), }) expect({ a: 1, b: 2, c: 3 }).toEqual( expect.objectContaining({ a: 1 }) ) expect([1, 2, 3, 4]).toEqual( expect.arrayContaining([1, 3]) ) expect('hello world').toEqual( expect.stringContaining('world') ) expect('hello world').toEqual( expect.stringMatching(/world$/) ) expect({ value: null }).toEqual({ value: expect.anything() // Matches anything except null/undefined }) // Negate with expect.not expect([1, 2]).toEqual( expect.not.arrayContaining([3]) ) ``` ## Soft Ass

references/core-hooks.mdHIGH
78.3%

Malicious tool definition detected

Tool: references/core-hooks.md Description: --- name: lifecycle-hooks description: beforeEach, afterEach, beforeAll, afterAll, and around hooks --- # Lifecycle Hooks ## Basic Hooks ```ts import { afterAll, afterEach, beforeAll, beforeEach, test } from 'vitest' beforeAll(async () => { // Runs once before all tests in file/suite await setupDatabase() }) afterAll(async () => { // Runs once after all tests in file/suite await teardownDatabase() }) beforeEach(async () => { // Runs before each test aw

references/features-concurrency.mdHIGH
78.3%

Malicious tool definition detected

Tool: references/features-concurrency.md Description: --- name: concurrency-parallelism description: Concurrent tests, parallel execution, and sharding --- # Concurrency & Parallelism ## File Parallelism By default, Vitest runs test files in parallel across workers: ```ts defineConfig({ test: { // Run files in parallel (default: true) fileParallelism: true, // Number of worker threads maxWorkers: 4, minWorkers: 1, // Pool type: 'threads', 'forks', 'vmThreads' pool: 'threads', }, }) ``` ## Concur

references/features-context.mdHIGH
78.3%

Malicious tool definition detected

Tool: references/features-context.md Description: --- name: test-context-fixtures description: Test context, custom fixtures with test.extend --- # Test Context & Fixtures ## Built-in Context Every test receives context as first argument: ```ts test('context', ({ task, expect, skip }) => { console.log(task.name) // Test name expect(1).toBe(1) // Context-bound expect skip() // Skip test dynamically }) ``` ### Context Properties - `task` - Test metadata (name, file, etc.) -

references/features-filtering.mdHIGH
78.3%

Malicious tool definition detected

test('slow test', { tags: ['slow', 'integration'] }, () => {}) ``` Run tagged tests: ```bash vitest --tags db vitest --tags "db,slow" # OR vitest --tags db --tags slow # OR ``` Configure allowed tags: ```ts defineConfig({ test: { tags: ['db', 'slow', 'integration'], strictTags: true, // Fail on unknown tags }, }) ``` ## Include/Exclude Patterns ```ts defineConfig({ test: { // Test file patterns include: ['**/*.{test,spec}.{ts,tsx}'], // Exclude patterns exclude: [ '**/node_modules/**', '**/

GENERATION.mdMEDIUM
61.4%

Tool passed security scan

SKILL.mdMEDIUM
51.8%

Tool passed security scan

Passed Files (6)Click to expand
references/features-coverage.mdOK
28.6%

Tool passed security scan

references/advanced-vi.mdOK
4.3%

Tool passed security scan

references/features-snapshots.mdOK
4.2%

Tool passed security scan

references/features-mocking.mdOK
3.7%

Tool passed security scan

references/core-test-api.mdOK
1.3%

Tool passed security scan

references/core-describe.mdOK
1.0%

Tool passed security scan

Audit Metadata
Max File Score
78%
Classification
UNKNOWN_SERVER
Files Scanned
18
Files Flagged
12
Chunks Analyzed
18
Analyzed
Feb 21, 2026, 11:38 PM
Security Audit — runlayer — vitest