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

ユースケース: Repository Test Setup
ユースケース: This package uses Bun and Vitest 4
ユースケース: 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 is adapted 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 の主な用途は?

主な用途は次のとおりです: ユースケース: Repository Test Setup, ユースケース: This package uses Bun and Vitest 4, ユースケース: 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 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

関連スキル

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
AI

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
AI

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
開発者