Testing
redis/RedisInsight
Unit/integration testing standards for RedisInsight using Jest and Testing Library: test structure, the renderComponent helper, faker for test data, mocking patterns, and waitFor instead of fixed…
A skill your agent uses when writing React hook tests, encountering test failures, flaky tests, cross-file contamination, or "Hook timed out" errors - Bun test patterns with proper spy cleanup
$ npx skills add udecode/kitcn --skill testing -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install udecode/kitcn testing --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/udecode/kitcn.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/testing .claude/skills/testing && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "testing" agent skill from https://github.com/udecode/kitcn/tree/main/.agents/skills/testing into .claude/skills/testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "testing", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/udecode/kitcn/tree/main/.agents/skills/testingType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add udecode/kitcn --skill testing -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install udecode/kitcn testing --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/udecode/kitcn.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/testing .agents/skills/testing && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "testing" agent skill from https://github.com/udecode/kitcn/tree/main/.agents/skills/testing into .agents/skills/testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "testing", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add udecode/kitcn --skill testing -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install udecode/kitcn testing --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/udecode/kitcn.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/testing .cursor/skills/testing && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "testing" agent skill from https://github.com/udecode/kitcn/tree/main/.agents/skills/testing into .cursor/skills/testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "testing", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/udecode/kitcn.git --path .agents/skills/testing--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add udecode/kitcn --skill testing -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install udecode/kitcn testing --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/udecode/kitcn.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/testing .gemini/skills/testing && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "testing" agent skill from https://github.com/udecode/kitcn/tree/main/.agents/skills/testing into .gemini/skills/testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "testing", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install udecode/kitcn testingInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add udecode/kitcn --skill testing -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/udecode/kitcn.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/testing .github/skills/testing && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "testing" agent skill from https://github.com/udecode/kitcn/tree/main/.agents/skills/testing into .github/skills/testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "testing", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add udecode/kitcn --skill testing -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install udecode/kitcn testing --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/udecode/kitcn.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/testing .opencode/skills/testing && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "testing" agent skill from https://github.com/udecode/kitcn/tree/main/.agents/skills/testing into .opencode/skills/testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "testing", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
testingA skill your agent uses when writing React hook tests, encountering test failures, flaky tests, cross-file contamination, or "Hook timed out" errors - Bun test patterns with proper spy cleanup
Testing is an agent skill from udecode/kitcn. Use when writing React hook tests, encountering test failures, flaky tests, cross-file contamination, or "Hook timed out" errors - Bun test patterns with proper spy cleanup
Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Testing & QA, covering Failing and flaky tests and React components. The repository describes itself as: Convex + Better Auth + tRPC + Drizzle + TanStack Query + shadcn. The licence is Apache-2.0.
4 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit c6010f5. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
bunFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Testing loads about 3.2k tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 825 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from udecode/kitcn at commit c6010f5, republished under its Apache-2.0 licence (© udecode). 825 words, ~3,163 tokens.
.claude/skills/testing/SKILL.md (or your agent's skills folder).Bun's test runner provides Jest-compatible API with TypeScript support and fast execution. Critical: Test globals (describe, it, expect, mock, spyOn, beforeEach, afterEach) are available globally via tooling/global.d.ts - no imports needed. mock.module() is process-global - use spyOn() instead.
[test]
# Preload scripts execute BEFORE any test file
preload = ["./tooling/test-setup.ts"]
# Coverage exclusions
coveragePathIgnorePatterns = [
"node_modules/**",
"**/*.d.ts",
]/// <reference types="bun-types/test-globals" />
declare var mock: typeof import("bun:test").mock;
declare var spyOn: typeof import("bun:test").spyOn;import { afterEach, expect, mock, spyOn } from "bun:test";
import { GlobalRegistrator } from "@happy-dom/global-registrator";
import * as matchers from "@testing-library/jest-dom/matchers";
import { cleanup } from "@testing-library/react";
// Make mock and spyOn globally available
(globalThis as any).mock = mock;
(globalThis as any).spyOn = spyOn;
// Register DOM globals synchronously
GlobalRegistrator.register();
// Ensure document.body exists
if (global.document && !global.document.body) {
const body = global.document.createElement("body");
global.document.documentElement.appendChild(body);
}
// Extend Bun's expect with Testing Library matchers
expect.extend(matchers);
// Cleanup after each test
afterEach(() => {
cleanup();
});bun add -d @happy-dom/global-registrator @testing-library/react @testing-library/jest-dom| Pattern | Use Case | Example |
|---|---|---|
| No imports needed | Test globals | describe, it, expect, mock, spyOn are global |
toMatchObject(array) | Array partial match | Checks properties exist, allows extras |
toEqual() | Exact match | Validates complete structure |
expect(val as any) | Type mismatch | Cast actual value, not expected |
mock() not jest.fn() | Create mock function | Bun test API |
spyOn() + afterEach | Mock with cleanup | Always spy.mockRestore() |
renderHook() + act() | Test hooks | Wrap state changes in act() |
void act() | Prevent warnings | Use with sync click/change events |
ReturnType<typeof mock> | Type mock variables | let mockFn: ReturnType<typeof mock> |
ReturnType<typeof spyOn> | Type spy variables | let spy: ReturnType<typeof spyOn> |
// NO bun:test imports needed - globals are available
import { act, renderHook } from "@testing-library/react";
import * as apiModule from "@/lib/api"; // Import as namespace for spyOn
describe("HookName", () => {
let mockFunction: ReturnType<typeof mock>;
let functionSpy: ReturnType<typeof spyOn>;
beforeEach(() => {
mockFunction = mock();
functionSpy = spyOn(apiModule, "functionName").mockImplementation(
mockFunction
);
mockFunction.mockResolvedValue(defaultResponse);
});
afterEach(() => {
// CRITICAL: Always restore spies
functionSpy.mockRestore();
});
it("should do something", async () => {
// Test implementation
});
});Problem: mock.module() is process-global. If fileA.test.ts uses mock.module('@/lib/api'), it contaminates fileB.test.ts.
Solution: Use spyOn() instead of mock.module().
// This globally mocks the module for ALL test files
mock.module("@/lib/api", () => ({
fetchData: mock(),
}));import * as apiModule from "@/lib/api";
describe("MyHook", () => {
let mockFetchData: ReturnType<typeof mock>;
let fetchDataSpy: ReturnType<typeof spyOn>;
beforeEach(() => {
mockFetchData = mock();
fetchDataSpy = spyOn(apiModule, "fetchData").mockImplementation(
mockFetchData
);
mockFetchData.mockResolvedValue({ data: "test" });
});
afterEach(() => {
fetchDataSpy.mockRestore();
});
it("fetches data", async () => {
const { result } = renderHook(() => useMyHook());
await act(async () => {
await result.current.fetch();
});
expect(mockFetchData).toHaveBeenCalled();
});
});Key differences:
import * as apiModule from './api'beforeEach: spyOn(apiModule, 'function')mockRestore() in afterEachexpect(mockFn) not expect(apiModule.fn)mock.module() Is AllowedUse mock.module() only for infrastructure every test needs, configured in a
preload, or for a module that will never be imported as real code elsewhere in
the same Bun process. It mutates process-global module state and may preserve
unmocked real exports while overriding only returned keys. The result can look
real while a few exports are poisoned.
Do not solve one contaminated test by lowering global concurrency, changing CI, or adding runtime dependency-indirection files solely for tests. Prefer a lower-level contract, a file-scoped spy, or a different integration harness.
mockReset() Destroys ImplementationsmockReset() clears calls and the implementation. Restore defaults immediately:
const fetchValue = mock(async () => "default");
beforeEach(() => {
fetchValue.mockReset();
fetchValue.mockResolvedValue("default");
});Use mockClear() when only call history should reset.
If a subject reads an environment flag at module scope, changing the mock after the static import cannot affect it. Set a mutable environment mock first, then dynamically import the subject. Add a deterministic cache-busting import query only when Bun otherwise reuses the module. Avoid random cache keys in committed tests when an incrementing case id works.
If a test passes alone and fails in the suite, run likely contaminators before the victim in one command:
bun test likely-contaminator.test.ts victim.test.tsRecord the minimal ordering that fails. Inspect module keys, critical function types, and resolved default values behind a temporary opt-in debug flag. Remove debug output after the owner is proven.
import { act, renderHook } from "@testing-library/react";
it("updates state correctly", async () => {
const { result } = renderHook(() => useCustomHook());
await act(async () => {
await result.current.fetchData();
});
expect(result.current.data).toEqual(expectedData);
expect(result.current.loading).toBe(false);
});
// Use void to prevent unused promise warnings
void act(() => getByText("button").click());Custom wrapper pattern for context providers:
const createWrapper = (props) => ({ children }: any) => (
<Provider {...props}>{children}</Provider>
);
const wrapper = createWrapper({ value: 'test' });
const { result } = renderHook(() => useCustomHook(), { wrapper });it("handles async errors", async () => {
mockFetch.mockRejectedValue(new Error("Network error"));
const { result } = renderHook(() => useCustomHook());
await act(async () => {
try {
await result.current.fetchData();
} catch (error) {
expect(error).toEqual(new Error("Failed to load"));
}
});
expect(result.current.error).toBe("Failed to load");
});// ✅ Array partial matching
expect(children).toMatchObject([{ text: "one" }, { text: "two" }]);
// ✅ Exact matching
expect(result).toEqual({ data: "test" });
// ✅ Cast actual value for type mismatches
expect(node as any).toEqual({ text: "one" });
// ❌ Don't cast expected value
expect(children).toEqual([{ text: "one" }] as any);
// ❌ Don't use toMatchObject() for single objects (won't catch extra props)
expect(node).toMatchObject({ text: "one" });# Run all tests
bun test
# Run specific file
bun test src/hooks/useMyHook.test.ts
# Watch mode
bun test --watch
# Coverage
bun test --coverage
# Bail on first failure
bun test --bail| Mistake | Problem | Fix |
|---|---|---|
Importing from bun:test | Unnecessary, globals available | Remove imports |
Using mock.module() | Cross-file contamination | Use spyOn() + afterEach cleanup |
Forgetting afterEach cleanup | Spies persist across tests | Always spy.mockRestore() |
| Direct import for spyOn | Can't spy on named exports | import * as module |
Forgetting act() | React warnings, flaky tests | Wrap state changes in act() |
jest.fn() / jest.Mock | Wrong framework | Use mock() and ReturnType<typeof mock> |
| No type for mocks | Type errors, autocomplete fails | ReturnType<typeof mock> |
Symptom: bun test file.test.ts passes, bun test fails.
Cause: Cross-file contamination from mock.module().
Fix:
mock.module() callsspyOn() pattern with afterEach cleanupCause: Wrong mock variable or wrong function name.
Fix:
spyOn(module, 'correctFunctionName')expect(mockFn) not expect(module.fn)Cause: Missing await, unresolved promise.
Fix:
awaitedmockResolvedValue()it('name', fn, 10000)mock.module() outside of preload scriptsafterEach() with mockRestore() callsAll indicate cross-file contamination. Refactor to spyOn pattern.
For each new hook test file:
bun:test - globals are availablerenderHook, act from @testing-library/react when testing hooksimport * as moduleReturnType<typeof mock>ReturnType<typeof spyOn>beforeEach with spyOn(module, 'fn')beforeEachafterEach with spy.mockRestore()act()© udecode, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/testing of udecode/kitcn.
Open the folder on GitHubat commit c6010f5
Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Testing this skilludecode/kitcn | 450 | — | ~3.2k | Automated safety check: Pass | Apache-2.0 | |
| Testingredis/RedisInsight | 8.9k | — | ~3.3k | Automated safety check: Pass | Custom licence | |
| Appbuilder Testingadobe/skills | 196 | — | ~2.8k | Automated safety check: Pass | Apache-2.0 | |
| Swig Testswig/swig | 6.3k | — | ~2.3k | Automated safety check: Pass | Custom licence | |
| Triage CI FailureDataDog/datadog-agent | 3.8k | — | ~2.3k | Automated safety check: Pass | Apache-2.0 | |
| Dynamo Jira TicketDynamoDS/Dynamo | 2k | — | ~1.1k | Automated safety check: Pass | Apache-2.0 |
redis/RedisInsight
Unit/integration testing standards for RedisInsight using Jest and Testing Library: test structure, the renderComponent helper, faker for test data, mocking patterns, and waitFor instead of fixed…
adobe/skills
Generate and run tests for Adobe App Builder actions and UI components.
swig/swig
Run SWIG test suite for specific languages. An agent skill from swig/swig.
DataDog/datadog-agent
Classify a failed CI as either caused by an active incident, flakiness, or a true code regression.
DynamoDS/Dynamo
Create structured Jira tickets for Dynamo from bug reports, failing tests, or feature requests.
fastrepl/anarlog
Inspect every open non-draft PR for CI failures and unresolved Cursor Bugbot findings, then fix them on the existing PR branches.
udecode/kitcn
Create a short annotated visual walkthrough from real final-state screenshots or rendered artifacts.
udecode/kitcn
Prevent feature creep when building software, apps, and AI-powered products.
udecode/kitcn
Repair an unreleased .changeset/.md file so it matches the real branch delta against main.
udecode/kitcn
Audit newer Convex npm releases against kitcn. An agent skill from udecode/kitcn.
udecode/kitcn
A skill your agent uses when working with Jotai X stores (createAtomStore), accessing state in components or callbacks, persisting state to cookies or localStorage
udecode/kitcn
Run a scoped Linear backlog autonomously as a sequence of maximal safe parallel batches by composing orchestrator, autogoal, and task.
Categories
A skill your agent uses when writing React hook tests, encountering test failures, flaky tests, cross-file contamination, or "Hook timed out" errors - Bun test patterns with proper spy cleanup. Testing is an agent skill from udecode/kitcn.
Testing fits situations like: writing React hook tests; encountering test failures; cross-file contamination; hook timed out errors - Bun test patterns with proper spy cleanup.
Run `npx skills add udecode/kitcn --skill testing -a claude-code`. Or copy the skill folder (.agents/skills/testing in udecode/kitcn) into .claude/skills/testing in your project. Claude Code loads it when a task matches its description.
Run `npx skills add udecode/kitcn --skill testing -a codex`. Or copy the skill folder (.agents/skills/testing in udecode/kitcn) into .agents/skills/testing in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add udecode/kitcn --skill testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/testing, .gemini/skills/testing, .github/skills/testing and .opencode/skills/testing in your project.
Going by SKILL.md and its folder, Testing needs the command-line tools its instructions call (bun).
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Testing is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Testing: Testing (redis/RedisInsight, 8.9k stars), Appbuilder Testing (adobe/skills, 196 stars), Swig Test (swig/swig, 6.3k stars) and Triage CI Failure (DataDog/datadog-agent, 3.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
udecode (a GitHub organization) maintains it in udecode/kitcn, which has 450 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on October 1, 2026.
Source: udecode/kitcn on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.