Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

grove-testing格罗夫测试

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

1,544

周安装

65

GitHub Stars

4

下载量

541
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:grove-testing(格罗夫测试)
来源仓库:https://github.com/autumnsgrove/groveengine
仓库路径:skills/grove-testing
安装命令:
npx skills add https://github.com/autumnsgrove/groveengine --skill grove-testing
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/autumnsgrove/groveengine --skill grove-testing

简介

grove-testing 用于辅助测试设计、自动化测试和用例整理。

  • 适用于编写单元测试、端到端测试或定位失败日志的场景。
  • 确认项目测试框架和运行命令,避免改坏真实逻辑。
  • 涉及浏览器或外部服务时区分本地模拟和测试环境。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Grove Testing Skill

When to Activate

Activate this skill when:

  • Deciding what to test (not just how)
  • Writing tests for new Grove features
  • Reviewing existing tests for effectiveness
  • Asked to "add tests" without specific guidance
  • Evaluating whether tests are providing real value
  • Refactoring causes many tests to break (symptom of bad tests)

For technical implementation (Vitest syntax, mocking patterns, assertions), use the javascript-testing skill alongside this one.


The Testing Philosophy

*"Write tests. Not too many. Mostly integration."* — Guillermo Rauch

This captures everything Grove believes about testing:

Write tests — Automated tests are worthwhile. They enable confident refactoring, serve as documentation, and catch regressions before users do.

Not too many — Tests have diminishing returns. The goal isn't coverage numbers. It's confidence. When you feel confident shipping, you have enough tests.

Mostly integration — Integration tests catch real problems without being brittle. They test behavior users actually experience, not internal implementation.

The Guiding Principle

*"The more your tests resemble the way your software is used, the more confidence they can give you."* — Kent C. Dodds (Testing Library)

Ask yourself: Does this test fail when the feature breaks? If yes, it's valuable. If it only fails during refactors, it's testing implementation details.


What Makes a Test Valuable

A good test has these properties (Kent Beck's Test Desiderata):

PropertyWhat It Means
Behavior-sensitiveFails when actual functionality breaks
Structure-immuneDoesn't break when you refactor safely
DeterministicSame result every time, no flakiness
FastGives feedback in seconds, not minutes
Clear diagnosisWhen it fails, you know exactly what broke
Cheap to writeEffort proportional to code complexity

The Confidence Test

Before writing a test, ask:

  1. Would I notice if this broke in production? If yes, test it.
  2. Would this test fail if the feature broke? If no, don't write it.
  3. Does this test resemble how users interact with the feature? If no, reconsider.

What NOT to Test

Not everything needs tests. Some things actively harm your codebase when tested.

Skip Testing

WhatWhy
Trivial codeGetters, setters, data models with no logic
Framework behaviorTrust that SvelteKit routing works
Implementation detailsInternal state, private methods, CSS classes
One-off scriptsMaintenance cost exceeds value
Volatile prototypesRequirements unclear, code will change

Test Lightly

WhatApproach
ConfigurationSmoke test that it loads, not every option
Third-party integrationsMock at boundaries, test your code's response
Visual designSnapshot tests or visual regression, not unit tests

Test Thoroughly

WhatWhy
Business logicCore value of the application
User-facing flowsWhat users actually experience
Edge casesError states, empty states, boundaries
Bug fixesEvery bug becomes a test to prevent regression

The Testing Trophy

Modern JavaScript testing follows the Testing Trophy, not the old Testing Pyramid:

                    ╭─────────╮
                    │   E2E   │  ← Few: critical user journeys
                    ╰────┬────╯
               ╭─────────┴─────────╮
               │   Integration     │  ← Many: this is where confidence lives
               ╰─────────┬─────────╯
                  ╭──────┴──────╮
                  │    Unit     │  ← Some: pure functions, algorithms
                  ╰──────┬──────╯
              ╭──────────┴──────────╮
              │   Static Analysis   │  ← TypeScript, ESLint (always on)
              ╰─────────────────────╯

What Each Layer Does

Static Analysis (TypeScript, ESLint)

  • Catches typos, type errors, obvious mistakes
  • Zero runtime cost, always running
  • This is your first line of defense

Unit Tests

  • Pure functions, algorithms, utilities
  • Fast, isolated, easy to debug
  • Don't mock everything—test real behavior where practical

Integration Tests (THE SWEET SPOT)

  • Multiple units working together
  • Tests behavior users actually experience
  • Less brittle than unit tests, faster than E2E
  • This is where most of your tests should live

E2E Tests (Playwright)

  • Critical user journeys only: login, checkout, core flows
  • Expensive to write and maintain
  • Reserve for flows where failure = business impact

Writing Effective Tests

Structure: Arrange-Act-Assert

Every test should follow this pattern:

it("should reject invalid email during registration", async () => {
	// Arrange: Set up the scenario
	const invalidEmail = "not-an-email";

	// Act: Do the thing
	const result = await registerUser({ email: invalidEmail, password: "valid123" });

	// Assert: Check the outcome
	expect(result.success).toBe(false);
	expect(result.error).toContain("email");
});

The Act section should be one line. If it's not, the test is probably doing too much.

Naming: Say What Breaks

Test names should describe the behavior, not the implementation:

Good names:

  • should reject registration with invalid email
  • should show error message when API fails
  • should preserve draft when navigating away

Bad names:

  • test email validation (what about it?)
  • handleSubmit works (what does "works" mean?)
  • test case 1 (no)

Test One Thing

Each test should have one reason to fail. If a test fails, you should immediately know what broke.

// Bad: Testing multiple things
it('should handle registration', async () => {
    // Tests validation, API call, redirect, AND email sending
});

// Good: Focused tests
it('should reject invalid email format', ...);
it('should call API with valid data', ...);
it('should redirect after successful registration', ...);
it('should send welcome email after registration', ...);

Testing Trust Boundaries (Rootwork)

Every trust boundary should have tests for both valid and invalid data:

Form actions: Submit with missing fields, wrong types, edge-case values → verify parseFormData() returns structured errors (not crashes)

KV reads: Mock KV returning corrupted/stale JSON → verify safeJsonParse() falls back to default

Cache reads: Mock cache service returning unexpected shapes → verify createTypedCacheReader() uses fallback

Catch blocks: Trigger redirects and HTTP errors → verify isRedirect()/isHttpError() route them correctly

Reference: Rootwork (@autumnsgrove/lattice/server) provides parseFormData, safeJsonParse, createTypedCacheReader, isRedirect, and isHttpError.


Integration Tests in Practice

Integration tests are the heart of Grove's testing strategy. Here's how to write them well.

Test User Behavior, Not Implementation

// Bad: Testing implementation
it("should set isLoading state to true", async () => {
	const { component } = render(LoginForm);
	await fireEvent.click(getByRole("button"));
	expect(component.isLoading).toBe(true); // Testing internal state!
});

// Good: Testing user experience
it("should show loading indicator while logging in", async () => {
	render(LoginForm);
	await fireEvent.click(getByRole("button", { name: /sign in/i }));
	expect(getByRole("progressbar")).toBeInTheDocument();
});

Use Accessible Queries

Query elements the way users find them:

// Priority order (best to worst):
getByRole("button", { name: /submit/i }); // How screen readers see it
getByLabelText("Email"); // Form fields
getByText("Welcome back"); // Visible text
getByTestId("login-form"); // Last resort

Don't Over-Mock

Mocks remove confidence in the integration. Use them sparingly:

// Over-mocked: False confidence
vi.mock("./api");
vi.mock("./validation");
vi.mock("./utils");
// You're testing... nothing real

// Better: Mock at boundaries
vi.mock("./external-api"); // Mock the network, not your code
// Let validation, utils, etc. run for real

Rule of thumb: If you're mocking something you wrote, reconsider.


When Tests Break

Tests that break are telling you something. Listen.

Good Breaks (Expected)

  • Feature changed — Test caught that behavior shifted. Update the test.
  • Bug fixed — Old test was wrong. Fix it.
  • Requirement changed — Test reflects old requirement. Update it.

Bad Breaks (Symptoms of Poor Tests)

  • Refactored internal code — Test was coupled to implementation. Rewrite it.
  • Changed CSS class — Test was querying implementation details. Use accessible queries.
  • Reordered code — Test depended on execution order. Make it order-independent.

If refactoring frequently breaks tests, your tests are testing the wrong things.


The Bug → Test Pipeline

Every production bug should become a test:

  1. Bug reported — User can't check out with certain items
  2. Reproduce locally — Find the exact conditions
  3. Write failing test — Captures the bug's conditions
  4. Fix the bug — Test now passes
  5. Test prevents regression — Bug can never return

This is one of the highest-value testing practices. It turns pain into protection.


Anti-Patterns to Avoid

The Ice Cream Cone

        ╭───────────────────────────╮
        │      Many E2E tests       │  ← Slow, brittle, expensive
        ╰───────────┬───────────────╯
              ╭─────┴─────╮
              │ Few int.  │
              ╰─────┬─────╯
                ╭───┴───╮
                │ Few   │
                │ unit  │
                ╰───────╯

This is backwards. E2E tests are expensive. Integration tests give the best ROI.

Testing Implementation Details

// Testing implementation (bad)
expect(component.state.items).toHaveLength(3);
expect(handleClick).toHaveBeenCalledWith({ id: 1 });

// Testing behavior (good)
expect(getByRole("list").children).toHaveLength(3);
expect(getByText("Item added!")).toBeInTheDocument();

Coverage Theater

Chasing 100% coverage leads to bad tests:

// Written only to hit coverage, provides zero value
it("should have properties", () => {
	const user = new User();
	expect(user.email).toBeDefined();
	expect(user.name).toBeDefined();
});

Coverage is a signal, not a goal. High coverage with bad tests is worse than moderate coverage with good tests.

Snapshot Abuse

Snapshots are useful for:

  • Complex serialized output
  • Error message formatting
  • API response shapes

Snapshots are harmful for:

  • UI components (break on every style change)
  • Anything with timestamps or random IDs
  • Large objects (nobody reviews 500-line snapshot diffs)

The Grove Testing Workflow

When asked to add tests, follow this workflow:

1. Understand the Feature

What does this feature do for users? Not how it's implemented—what value does it provide?

2. Identify Critical Paths

What would break if this feature failed? Those are your test cases.

3. Write Integration Tests First

Start with tests that exercise real user behavior. Add unit tests only for complex logic.

4. Keep Tests Close to Code

src/
└── lib/
    └── features/
        └── auth/
            ├── login.ts
            ├── login.test.ts      ← Right next to the code
            └── register.ts

5. Run Tests Continuously

npx vitest              # Watch mode during development
npx vitest run          # CI verification

Quick Decision Guide

SituationAction
New featureWrite integration tests for user-facing behavior
Bug fixWrite test that reproduces bug first, then fix
RefactoringRun existing tests; if they break on safe changes, they're bad tests
"Need more coverage"Add tests for uncovered behavior, not uncovered lines
Pure function/algorithmUnit test it
API endpointIntegration test with mocked external services
UI componentComponent test with Testing Library
Critical user flowE2E test with Playwright

Integration with Other Skills

javascript-testing

Use javascript-testing for:

  • Vitest configuration syntax
  • Mocking patterns and APIs
  • Assertion reference
  • SvelteKit-specific test patterns

grove-documentation

When writing test descriptions, follow Grove voice:

  • Clear, direct names
  • No jargon
  • Say what the user experiences

code-quality

Run linting and type checking before/after writing tests. Static analysis catches different bugs than tests do.


Self-Review Checklist

Before considering tests "done":

  • Tests describe user behavior, not implementation
  • Each test has one clear reason to fail
  • Tests use accessible queries (getByRole, getByLabelText)
  • Mocks are limited to external boundaries
  • Test names explain what breaks when they fail
  • No snapshot tests for volatile content
  • Bug fixes include regression tests
  • Tests run fast (seconds, not minutes)

*Good tests let you ship with confidence. That's the whole point.*

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.38%
按下载量换算191

Claude

31.81%
按下载量换算172

Cursor

17.15%
按下载量换算93

Gemini CLI

8.34%
按下载量换算45

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills