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

이 스킬 정보

적합한 상황: Ideal for AI agents that need repository test setup. 현지화된 요약: ## Repository Test Setup This package uses Bun and Vitest 4. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

기능

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.

# 핵심 주제

Mnigos Mnigos
[1]
[0]
업데이트: 5/3/2026

Skill Overview

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

적합한 상황: Ideal for AI agents that need repository test setup. 현지화된 요약: ## Repository Test Setup This package uses Bun and Vitest 4. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

이 스킬을 사용하는 이유

추천 설명: 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.

최적의 용도

적합한 상황: Ideal for AI agents that need repository test setup.

실행 가능한 사용 사례 for testing-vitest

사용 사례: Applying Repository Test Setup
사용 사례: Applying This package uses Bun and Vitest 4
사용 사례: Applying Unit tests run with bun run test

! 보안 및 제한 사항

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

About The Source

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

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 및 설치 단계

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

? 자주 묻는 질문

testing-vitest은 무엇인가요?

적합한 상황: Ideal for AI agents that need repository test setup. 현지화된 요약: ## Repository Test Setup This package uses Bun and Vitest 4. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

testing-vitest은 어떻게 설치하나요?

다음 명령을 실행하세요: npx killer-skills add Mnigos/platform-hono/testing-vitest. Cursor, Windsurf, VS Code, Claude Code와 19개 이상의 다른 IDE에서 동작합니다.

testing-vitest은 어디에 쓰이나요?

주요 활용 사례는 다음과 같습니다: 사용 사례: Applying Repository Test Setup, 사용 사례: Applying This package uses Bun and Vitest 4, 사용 사례: Applying Unit tests run with bun run test.

testing-vitest 와 호환되는 IDE는 무엇인가요?

이 스킬은 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 와 호환됩니다. 통합 설치에는 Killer-Skills CLI를 사용하세요.

testing-vitest에 제한 사항이 있나요?

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

이 스킬 설치 방법

  1. 1. 터미널 열기

    프로젝트 디렉터리에서 터미널 또는 명령줄을 여세요.

  2. 2. 설치 명령 실행

    npx killer-skills add Mnigos/platform-hono/testing-vitest 를 실행하세요. CLI가 IDE 또는 에이전트를 자동으로 감지하고 스킬을 설정합니다.

  3. 3. 스킬 사용 시작

    스킬이 이제 활성화되었습니다. 현재 프로젝트에서 testing-vitest을 바로 사용할 수 있습니다.

! 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 comes 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 comes 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

관련 스킬

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

모두 보기

openclaw-release-maintainer

Logo of openclaw
openclaw

현지화된 요약: 🦞 # 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
인공지능

widget-generator

Logo of f
f

현지화된 요약: 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 Windsurf

149.6k
0
인공지능

flags

Logo of vercel
vercel

현지화된 요약: 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
브라우저

pr-review

Logo of pytorch
pytorch

현지화된 요약: 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
개발자