본문으로 건너뛰기
cccskills
무료GitHub에 공개

testing

Write and run tests for features and fixes, starting with likely failures and boundary cases. Use behavior-focused checks, suitable test environments, and coverage results to assess whether changes are ready.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Testing workflow and quality standards for writing and running tests. Use when: (1) Writing new tests, (2) Adding a new feature that needs tests, (3) Modifying logic that has existing tests, (4) Before claiming a task is complete.

연동 도구Playwright
설치 방법 보기

이럴 때 유용합니다

  • Writing tests for a new feature
  • Adding regression tests for a bug fix
  • Updating existing tests after behavior changes
  • Checking test results and coverage before submission

포함된 파일(1)

  • SKILL.md4.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Testing Skill

Standards and workflow for writing and running tests. Every feature must be tested.

Announce at start: "I'm using testing skill to ensure proper test coverage."

Trigger Conditions

  • Writing new tests for a feature or bug fix
  • Adding a new feature (must include tests)
  • Modifying logic that has existing tests (must update them)
  • Before claiming work is complete
  • Before committing code

Framework

Vitest 4 — configured in vitest.config.ts.

Test Structure

tests/
├── unit/          # Individual functions, utilities, components
├── integration/   # IPC, database, service interactions
├── regression/    # Regression test cases
└── e2e/           # End-to-end tests (Playwright, playwright.config.ts)

Two Test Environments

EnvironmentWhenFile naming
node (default)Main process, utilities, services*.test.ts
jsdomDOM/browser-dependent code*.dom.test.ts

Workflow

Step 1: Identify What to Test

Before writing tests, list the riskiest scenarios first:

  • What happens when the dependency returns undefined / throws?
  • What happens at boundaries (empty list, max retries, past timestamp)?
  • What is most likely to break in production?

Step 2: Write Tests

Follow these quality rules:

1. Describe behavior, not code structure

// Wrong — describes implementation
it('should call repo.getConversation', ...)

// Correct — describes behavior
it('should return cached task without hitting repo on second call', ...)
it('should reject with error when conversation does not exist', ...)

2. Every describe block must cover at least one failure path

Happy-path-only tests leave the most dangerous code untested.

3. One behavior per test

Keep each it() focused. More than 3 expect() calls in one test is a signal it is testing too much at once.

4. Self-check

After writing a test, mentally delete the core logic it targets. If the test would still pass, rewrite it — it is not guarding anything.

5. Start from risk, not from coverage gaps

List scenarios most likely to produce bugs. Write those first. Coverage is the outcome, not the starting point.

Step 3: Run Tests

bun run test              # Run all tests (REQUIRED before every commit)
bun run test:coverage     # Check coverage (before opening a PR)

Step 4: Verify Coverage

Coverage target: ≥ 80% for all source files matched by vitest.config.ts → coverage.include (currently src/**/*.{ts,tsx} plus a few scripts).

New source files are automatically included in coverage — no manual config changes needed. If a new file is accidentally excluded by a rule in coverage.exclude, remove it from the exclude list.

Step 5: Update Existing Tests

When modifying logic, check if existing tests need updating:

bun run test -- --reporter=verbose   # See which tests pass/fail with names

If a test fails because the behavior changed intentionally, update the test. If it fails unexpectedly, investigate.

Edge Case Checklist

When testing a module, verify:

  • null / undefined inputs handled
  • Empty arrays/objects handled
  • Error thrown by dependencies handled
  • Boundary values (0, -1, max, empty string)
  • Async operations (timeout, rejection, cancellation)

Quick Checklist

Before submitting code:

  • New features have corresponding test cases
  • Modified logic has updated tests
  • bun run test passes
  • Tests describe behavior, not implementation
  • At least one failure path per describe block
  • New source files are not accidentally excluded by coverage.exclude
  • bun run test:coverage meets ≥ 80% target

Common Mistakes

MistakeCorrect
Testing implementation detailsTest observable behavior
Only testing happy pathMust include at least one failure path
5+ expects in one it()Split into separate tests
Skipping tests for "simple" codeSimple code breaks too — test the risky parts
Writing tests after saying "done"Tests are part of "done", not an afterthought

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Organize an Electron app by placing new code in the right process and directory. Apply naming rules, component structure conventions, and process boundaries to guide additions and review existing code.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Choosing where new code belongs
  • Splitting a component into multiple files
  • Reviewing process boundaries and directory structure
iOfficeAI/AionUi3.4만2026년 10월 14일 업데이트

Prepare an AionUi release by checking AionCore assets, updating versions, and generating a changelog. Run quality checks, create a pull request with automatic merging enabled, then tag the merged release to trigger its build.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Releasing the next AionUi patch version
  • Releasing with explicitly chosen UI and Core versions
  • Preparing a frontend-only release
iOfficeAI/AionUi3.4만2026년 10월 14일 업데이트

i18n

무료

Manage multilingual interface text through translation keys. Follow the configured language list, reuse existing wording, update every locale, and regenerate and validate key types when adding text or translation modules.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Adding interface text in every supported language
  • Building components with translatable text
  • Creating a translation module for a new feature
iOfficeAI/AionUi3.4만2026년 10월 14일 업데이트

iOfficeAI의 스킬 모두 보기

이 스킬의 문제 신고