testing-vitest — for Claude Code testing-vitest, platform-hono, community, for Claude Code, ide skills, bun run test, bun run test:coverage, bun run test:integration, bun run typecheck, bun run check

v1.0.0

Acerca de este Skill

Escenario recomendado: Ideal for AI agents that need repository test setup. Resumen localizado: ## Repository Test Setup This package uses Bun and Vitest 4. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

Características

Repository Test Setup
This package uses Bun and Vitest 4.
Unit tests run with bun run test.
Coverage runs with bun run test:coverage.
Integration tests run with bun run test:integration.

# Temas principales

Mnigos Mnigos
[1]
[0]
Actualizado: 5/3/2026

Skill Overview

Start with fit, limitations, and setup before diving into the repository.

Escenario recomendado: Ideal for AI agents that need repository test setup. Resumen localizado: ## Repository Test Setup This package uses Bun and Vitest 4. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

¿Por qué usar esta habilidad?

Recomendacion: testing-vitest helps agents repository test setup. Repository Test Setup This package uses Bun and Vitest 4. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

Mejor para

Escenario recomendado: Ideal for AI agents that need repository test setup.

Casos de uso accionables for testing-vitest

Caso de uso: Repository Test Setup
Caso de uso: This package uses Bun and Vitest 4
Caso de uso: Unit tests run with bun run test

! Seguridad y limitaciones

  • Limitacion: Vitest globals are enabled. Do not import describe, test, expect, vi, or hooks from vitest.
  • Limitacion: Assert inline when there is only one meaningful assertion against the value.
  • Limitacion: Use a named value only when it improves readability or supports multiple assertions.

About The Source

The section below is adapted from the upstream repository. Use it as supporting material alongside the fit, use-case, and installation summary on this page.

Demo Labs

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

FAQ y pasos de instalación

These questions and steps mirror the structured data on this page for better search understanding.

? Preguntas frecuentes

¿Qué es testing-vitest?

Escenario recomendado: Ideal for AI agents that need repository test setup. Resumen localizado: ## Repository Test Setup This package uses Bun and Vitest 4. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

¿Cómo instalo testing-vitest?

Ejecuta el comando: npx killer-skills add Mnigos/platform-hono/testing-vitest. Funciona con Cursor, Windsurf, VS Code, Claude Code y más de 19 IDE adicionales.

¿Cuáles son los casos de uso de testing-vitest?

Los casos de uso principales incluyen: Caso de uso: Repository Test Setup, Caso de uso: This package uses Bun and Vitest 4, Caso de uso: Unit tests run with bun run test.

¿Qué IDE son compatibles con testing-vitest?

Esta skill es compatible con Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Usa la CLI de Killer-Skills para una instalación unificada.

¿Tiene limitaciones testing-vitest?

Limitacion: Vitest globals are enabled. Do not import describe, test, expect, vi, or hooks from vitest.. Limitacion: Assert inline when there is only one meaningful assertion against the value.. Limitacion: Use a named value only when it improves readability or supports multiple assertions..

Cómo instalar este skill

  1. 1. Abre tu terminal

    Abre la terminal o línea de comandos en el directorio de tu proyecto.

  2. 2. Ejecuta el comando de instalación

    Ejecuta: npx killer-skills add Mnigos/platform-hono/testing-vitest. La CLI detectará tu IDE o agente automáticamente y configurará la skill.

  3. 3. Empieza a usar el skill

    El skill ya está activo. Tu agente de IA puede usar testing-vitest de inmediato en el proyecto actual.

! Source Notes

This page is still useful for installation and source reference. Before using it, compare the fit, limitations, and upstream repository notes above.

Upstream Repository Material

The section below is adapted from the upstream repository. Use it as supporting material alongside the fit, use-case, and installation summary on this page.

Upstream Source

testing-vitest

## Repository Test Setup This package uses Bun and Vitest 4. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows. Repository Test Setup

SKILL.md
Readonly
Upstream Repository Material
The section below is adapted from the upstream repository. Use it as supporting material alongside the fit, use-case, and installation summary on this page.
Upstream Source

Repository Test Setup

This package uses Bun and Vitest 4.

  • Unit tests run with bun run test.
  • Coverage runs with bun run test:coverage.
  • Integration tests run with bun run test:integration.
  • Type checking runs with bun run typecheck.
  • Formatting/linting runs with bun run check or bun run check:fix.

vitest.config.ts excludes tests/integration/**/*.integration.spec.ts. vitest.integration.config.ts includes only tests/integration/**/*.integration.spec.ts, disables file parallelism, and uses one worker.

Vitest Globals

Vitest globals are enabled. Do not import describe, test, expect, vi, or hooks from vitest.

typescript
1// Wrong - unnecessary imports 2import { describe, expect, test, vi } from 'vitest'

Use test, not it.

Test Placement

  • Put focused unit tests near the behavior they exercise, using *.spec.ts.
  • Put tests that boot a server, bind ports, or exercise full request flow under tests/integration/**/*.integration.spec.ts.
  • Prefer testing exported behavior from src/index.ts or public module exports. Reach into internal files only when the behavior is intentionally internal and difficult to verify through the public adapter.

Spy Naming

Name spies after the method, suffixed with Spy.

typescript
1const warnSpy = vi.spyOn(Logger.prototype, 'warn').mockImplementation(() => {}) 2const jsonSpy = vi.spyOn(ctx, 'json').mockReturnValue(response) 3 4// Wrong - generic name 5const spy = vi.spyOn(Logger.prototype, 'warn')

Set up vi.spyOn() before calling the function under test.

Assertions

Assert inline when there is only one meaningful assertion against the value.

typescript
1expect(await adapter.reply(ctx, { ok: true })).toBeUndefined()

Use a named value only when it improves readability or supports multiple assertions.

typescript
1const response = await app.request('/health') 2 3expect(response.status).toBe(200) 4await expect(response.json()).resolves.toEqual({ ok: true })

Error Testing

Use .rejects or .toThrow, not try/catch.

typescript
1await expect(adapter.reply(ctx, body)).rejects.toBeInstanceOf(Error) 2expect(() => adapter.render()).toThrow('Method not implemented.')

For multiple async error assertions, store the promise.

typescript
1const promise = adapter.reply(ctx, body) 2 3await expect(promise).rejects.toBeInstanceOf(Error) 4await expect(promise).rejects.toMatchObject({ message: 'boom' })

Mock Placement

Always put imports first. Write vi.mock(...) after imports, even though Vitest hoists mock calls.

Do not declare mock variables above imports. Prefer inline mock factories and assert through the mocked import.

typescript
1import { serveStatic } from '@hono/node-server/serve-static' 2 3vi.mock('@hono/node-server/serve-static', () => ({ 4 serveStatic: vi.fn() 5})) 6 7vi.mocked(serveStatic).mockReturnValue(async () => undefined)

Hono Adapter Tests

Prefer real Hono requests for route behavior.

typescript
1const adapter = new HonoAdapter() 2 3adapter.get('/hello', (_req, ctx) => { 4 return ctx.text('hello') 5}) 6 7const response = await adapter.hono.request('/hello') 8 9expect(response.status).toBe(200) 10await expect(response.text()).resolves.toBe('hello')

For behavior that depends on Nest abstractions, use the smallest fake Context or request object needed. Keep the fake local to the spec unless the same shape repeats across multiple files.

Cleanup

Use afterEach for mock cleanup.

typescript
1afterEach(() => { 2 vi.restoreAllMocks() 3})

Use vi.clearAllMocks() only when keeping the same mocked implementations matters. Close any servers started in integration tests.

TypeScript Style In Tests

Follow the repository rules:

  • Do not add explicit function or method return type annotations unless they are strictly needed.
  • Prefer interfaces over type aliases for object shapes.
  • Avoid any; test files allow it, but use unknown, narrow fakes, or imported types when reasonable.
  • Match existing Biome formatting: tabs, single quotes, no semicolons.

Anti-Patterns

  • Importing Vitest globals.
  • Using it instead of test.
  • Generic spy names such as const spy = ....
  • Creating spies after the code under test has already run.
  • try/catch for error testing.
  • Over-building Nest testing modules for behavior that can be tested with the adapter or Hono directly.
  • Leaving bound servers open in integration tests.
  • Adding return type annotations just because a function is exported.

Verification

bash
1bun run test 2bun run test:integration 3bun run typecheck 4bun run check

Habilidades relacionadas

Looking for an alternative to testing-vitest or another community skill for your workflow? Explore these related open-source skills.

Ver todo

openclaw-release-maintainer

Logo of openclaw
openclaw

Resumen localizado: 🦞 # OpenClaw Release Maintainer Use this skill for release and publish-time workflow. It covers ai, assistant, crustacean workflows. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

333.8k
0
Inteligencia Artificial

widget-generator

Logo of f
f

Resumen localizado: Generate customizable widget plugins for the prompts.chat feed system # Widget Generator Skill This skill guides creation of widget plugins for prompts.chat. It covers ai, artificial-intelligence, awesome-list workflows. This AI agent skill supports Claude Code, Cursor, and

149.6k
0
Inteligencia Artificial

flags

Logo of vercel
vercel

Resumen localizado: The React Framework # Feature Flags Use this skill when adding or changing framework feature flags in Next.js internals. It covers blog, browser, compiler workflows. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

138.4k
0
Navegador

pr-review

Logo of pytorch
pytorch

Resumen localizado: Usage Modes No Argument If the user invokes /pr-review with no arguments, do not perform a review. It covers autograd, deep-learning, gpu workflows. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

98.6k
0
Desarrollador