Agent skill

Testing

by LedgerHQ in LedgerHQ/ledger-live

Write unit and integration tests for Ledger Wallet apps. An agent skill from LedgerHQ/ledger-live.

MITAuto-check passedTesting & QA

Install Testing

skills CLI
$ npx skills add LedgerHQ/ledger-live --skill testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install LedgerHQ/ledger-live testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/LedgerHQ/ledger-live.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/testing .claude/skills/testing && rm -rf skills-src

Use ~/.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/

Facts

Skill name
testing
GitHub stars
621
Token cost
~1.8k tokens
SKILL.md length
368 words
Files
1
Skills in repo
50
Repo updated
First seen
Licence
MIT

At a glance

Write unit and integration tests for Ledger Wallet apps. An agent skill from LedgerHQ/ledger-live.

  • Works in 7 steps: toBeVisible() over toBeInTheDocument() —… → Search before you create — Before… → Mock external deps only — Never mock… → …
  • Jest tests (Desktop/Mobile)
  • SKILL.md covers Golden Rules, Quick Reference, Test Template and Testing Hooks, plus 5 more sections
  • Calls pnpm and rg

What it does

Testing is an agent skill from LedgerHQ/ledger-live. Write unit and integration tests for Ledger Wallet apps. Use for Jest tests (Desktop/Mobile), MSW handlers and testing best practices. Applies to ".test.", ".spec.", "/tests/", "/tests/", "/integrations/", "/jest-setup"

Its SKILL.md is about 1.8k 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 Unit testing, Integration testing and Test strategy. It works with Jest. The repository describes itself as: Mono-repository for Ledger Wallet apps and related packages. The licence is MIT.

When your agent uses it

  • Jest tests (Desktop/Mobile)
  • MSW handlers and testing best practices

Example prompts

  • “.test.”
  • “.spec.”
  • “/tests/”
  • “/testing”

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. toBeVisible() over toBeInTheDocument() — Always. toBeInTheDocument only checks DOM presence; elements can be hidden. Use toBeInTheDocument…
  2. Search before you create — Before writing any mock, fixture, or helper, rg the codebase. If it exists, import it. If your new mock is…
  3. Mock external deps only — Never mock child components. Test integration.
  4. One behavior per test — Name: it("should when ").
  5. Query priority: getByRole > getByLabelText > getByText > getByTestId (last resort).
  6. Feature flags via store, never mocked — Use overriddenFeatureFlags in initialState.settings.
  7. Use existing factories — genAccount() from @ledgerhq/ledger-wallet-framework/mocks/account, getCryptoCurrencyById() from…

What it can do on your machine

Read from SKILL.md and the folder at commit a3861a2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Shell commands in SKILL.md call:

    • pnpm
    • rg

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Testing loads about 1.8k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 368 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~64
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from LedgerHQ/ledger-live at commit a3861a2, republished under its MIT licence (© LedgerHQ). 368 words, ~1,770 tokens.

Download SKILL.mdSave it as .claude/skills/testing/SKILL.md (or your agent's skills folder).
name
testing
description
Write unit and integration tests for Ledger Wallet apps. Use for Jest tests (Desktop/Mobile), MSW handlers and testing best practices. Applies to "*.test.*", "*.spec.*", "**/tests/**", "**/__tests__/**", "**/__integrations__/**", "**/jest-setup*"

Ledger Wallet Testing Skill

Jest + MSW + React Testing Library (Desktop) / React Native Testing Library (Mobile) ❌ E2E tests → Use e2e skill


Golden Rules

  1. toBeVisible() over toBeInTheDocument() — Always. toBeInTheDocument only checks DOM presence; elements can be hidden. Use toBeInTheDocument only when testing explicitly hidden elements.
  2. Search before you create — Before writing any mock, fixture, or helper, rg the codebase. If it exists, import it. If your new mock is reusable (2+ files), put it in a shared location.
  3. Mock external deps only — Never mock child components. Test integration.
  4. One behavior per test — Name: it("should <behavior> when <condition>").
  5. Query priority: getByRole > getByLabelText > getByText > getByTestId (last resort).
  6. Feature flags via store, never mocked — Use overriddenFeatureFlags in initialState.settings.
  7. Use existing factories — genAccount() from @ledgerhq/ledger-wallet-framework/mocks/account, getCryptoCurrencyById() from @ledgerhq/live-common/currencies. Never recreate account/currency data from scratch.

Quick Reference

bash
pnpm test:jest "filename"    # Run specific file
pnpm test:jest               # Run all tests
pnpm test:jest --coverage    # Coverage report

# Coin modules (libs/coin-modules)
pnpm coin:<name> test              # Unit tests
pnpm coin:<name> test "filename"   # Specific file
pnpm coin:<name> test-integ        # Integration tests (slow)
PlatformRender ImportMSW Server
Desktoptests/testSetuptests/server.ts
Mobile@tests/test-renderer__tests__/server.ts

Test Template

typescript
import { render, screen, waitFor } from "tests/testSetup";
import { server } from "tests/server";
import { http, HttpResponse } from "msw";

jest.mock("@ledgerhq/live-common/someService");

describe("MyComponent", () => {
  beforeEach(() => jest.clearAllMocks());

  it("should render title", () => {
    render(<MyComponent title="Test" />);
    expect(screen.getByText("Test")).toBeVisible();
  });

  it("should call onClick when button pressed", async () => {
    const onClick = jest.fn();
    const { user } = render(<MyComponent onClick={onClick} />);
    await user.click(screen.getByRole("button"));
    expect(onClick).toHaveBeenCalledTimes(1);
  });

  it("should display fetched data", async () => {
    server.use(http.get("/api/data", () => HttpResponse.json({ name: "Bitcoin" })));
    render(<MyComponent />);
    await waitFor(() => expect(screen.getByText("Bitcoin")).toBeVisible());
  });
});

Testing Hooks

typescript
import { renderHook, act, waitFor } from "tests/testSetup";

const { result } = renderHook(() => useMyHook());
await act(async () => result.current.increment());
expect(result.current.value).toBe(1);

Redux Store

Desktop — plain object merged with defaults:

typescript
render(<MyComponent />, {
  initialState: {
    settings: { theme: "dark" },
    accounts: { active: [mockAccount] },
  },
});

Mobile — function receiving default state:

typescript
render(<MyScreen />, {
  overrideInitialState: (state: State) => ({
    ...state,
    settings: { ...state.settings, blacklistedTokenIds: ["ethereum/erc20/usdt"] },
  }),
});

Feature flags (both platforms):

typescript
render(<MyComponent />, {
  initialState: {
    settings: {
      overriddenFeatureFlags: {
        myFlag: { enabled: true, params: { key: "value" } },
      },
    },
  },
});

Mocking Patterns

typescript
// External dependency
jest.mock("@ledgerhq/live-common/account/index");
const mockedFn = jest.mocked(getMainAccount);
mockedFn.mockReturnValue(mockAccount);

// ViewModel (MVVM)
jest.mock("../useMyViewModel", () => ({ useMyViewModel: jest.fn() }));
jest.spyOn(UseMyViewModel, "useMyViewModel").mockImplementation(() => ({
  data: mockData,
  isLoading: false,
}));

// MSW override for error case
server.use(http.get("/api/data", () => HttpResponse.json({ error: "Not found" }, { status: 404 })));

Shared Resources — Search Here First

Before creating anything, check these locations:

LocationWhat's there
@ledgerhq/ledger-wallet-framework/mocks/accountgenAccount(), genTokenAccount()
@ledgerhq/live-common/currenciesgetCryptoCurrencyById(), getTokenById()
tests/handlers/MSW handlers (market, assets, countervalues, cryptoIcons)
tests/handlers/fixtures/JSON fixtures for API responses
tests/fixtures/mockedAccountList, expectedCurrencyList
tests/mocks/Mock components, assets, countervalues
bash
# Run BEFORE writing new mocks
rg "yourMockName|yourHelper" tests/ __tests__/ src/ libs/ --type ts

New reusable mocks go in tests/mocks/, new handlers in tests/handlers/, new fixtures in tests/handlers/fixtures/.


Show full SKILL.md (142 more words)Show less

Mock Anti-Patterns

These cause flaky tests and mock cannibalization when running with parallel workers (--maxWorkers=50%).

Duplicate mocks — Don't jest.mock("module") in a test file when it's already mocked in jest-setup (apps/ledger-live-mobile/__tests__/jest-setup.js or apps/ledger-live-desktop/tests/jestSetup.js). Use jest.mocked(module.export).mockReturnValue(...) in beforeEach instead.

Hooks at describe load time — Never call renderHook(...) or access .result.current at the top level of a describe block. Move into beforeEach or inside each test — calling hooks outside of test callbacks crashes Jest parallel workers.

jest.restoreAllMocks() — Never use this; it restores global mocks from jest-setup and breaks other tests. Use jest.clearAllMocks() or mock.mockRestore() for specific spies only.

Wrong beforeEach order — Call jest.clearAllMocks() before mockReturnValue() or other mock configuration — not after (calling clear after wipes the setup).


Workflow

1. Search for existing mocks → 2. Write test → 3. Run test → 4. Fix if fail → 5. Next file

Start with the simplest units (utils, hooks), then work up to components with side effects (API, navigation). This order catches foundational bugs early and builds confidence incrementally.

© LedgerHQ, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/testing of LedgerHQ/ledger-live.

Open the folder on GitHubat commit a3861a2

Compare with similar skills

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.

Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Testing this skillLedgerHQ/ledger-live621—~1.8kAutomated safety check: PassMIT
Designing TestsCloudAI-X/claude-workflow-v21.4k1 repos~1.5kAutomated safety check: PassMIT
Async Test And Doc Syncdiscord-php/DiscordPHP1.1k—~3.4kAutomated safety check: NotesMIT
Write Testsgrafana/synthetic-monitoring-app171—~1.2kAutomated safety check: PassAGPL-3.0
Robotics Testingarpitg1304/robotics-agent-skills368—~4.7kAutomated safety check: PassApache-2.0
Akka.NET Testing PatternsAaronontheweb/dotnet-skills1.2k1 repos~2.4kAutomated safety check: PassMIT

Similar skills

  • Designing Tests

    CloudAI-X/claude-workflow-v2

    Designs and implements testing strategies for any codebase. An agent skill from CloudAI-X/claude-workflow-v2.

    1.4k GitHub starsUsed in 1 repo~1.5k tokens
    Testing & QAAuto-check passed
  • Async Test And Doc Sync

    discord-php/DiscordPHP

    Maintain test and documentation alignment — PHPUnit tests, async testing patterns, PHPDoc contracts, guide pages, and documentation workflow.

    1.1k GitHub stars~3.4k tokensUpdated yesterday
    Testing & QAAuto-check: notes
  • Write Tests

    grafana/synthetic-monitoring-app

    Official

    Write Jest integration and unit tests for the Grafana Synthetic Monitoring app using React Testing Library, MSW, and src/test helpers.

    171 GitHub stars~1.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Robotics Testing

    arpitg1304/robotics-agent-skills

    Testing strategies, patterns, and tools for robotics software.

    368 GitHub stars~4.7k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Akka.NET Testing Patterns

    Aaronontheweb/dotnet-skills

    Shows how to test Akka.NET actors with Akka.Hosting.TestKit: swapping services for fakes, using TestProbes, and checking persistence, plus when the older TestKit still fits.

    1.2k GitHub starsUsed in 1 repo~2.4k tokens
    Testing & QAAuto-check passed
  • Rust Testing

    kurealnum/dotfiles

    Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage.

    290 GitHub starsUsed in 6 repos~2.9k tokens
    Testing & QAAuto-check passed

More from LedgerHQ/ledger-live

All 50 skills in this repo
  • Impacting PRs

    LedgerHQ/ledger-live

    Find which open PRs are impacted by a migration/sunset/refactor and notify their authors — blocking review when the old path is already gone from develop, heads-up comment when it is only deprecated…

    621 GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Cloud Sync Module

    LedgerHQ/ledger-live

    Write, review or debug a cloudSyncModule.ts — a CloudSyncDataManager that syncs one slice of user data through Ledger Sync (Cloud Sync).

    621 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Codeownership

    LedgerHQ/ledger-live

    Maintain CODEOWNERS file and team directories. An agent skill from LedgerHQ/ledger-live.

    621 GitHub stars~687 tokensUpdated today
    Auto-check passed
  • Coin Families Contract

    LedgerHQ/ledger-live

    Coin-specific families logic must live in families/. An agent skill from LedgerHQ/ledger-live.

    621 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Data Layer Advanced

    LedgerHQ/ledger-live

    Structure a Ledger Wallet data layer where one API response serves several entities.

    621 GitHub stars~509 tokensUpdated today
    Auto-check passed
  • Debug Rn Native Crash

    LedgerHQ/ledger-live

    Investigate native React Native crashes (Fabric/Hermes/iOS) in ledger-live-mobile when JS error logs are missing or unhelpful.

    621 GitHub stars~1.2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Testing

What does Testing do?

Write unit and integration tests for Ledger Wallet apps. An agent skill from LedgerHQ/ledger-live. Testing is an agent skill from LedgerHQ/ledger-live. Write unit and integration tests for Ledger Wallet apps.

When should I use Testing?

Testing fits situations like: jest tests (Desktop/Mobile); MSW handlers and testing best practices.

How do I install Testing in Claude Code?

Run `npx skills add LedgerHQ/ledger-live --skill testing -a claude-code`. Or copy the skill folder (.agents/skills/testing in LedgerHQ/ledger-live) into .claude/skills/testing in your project. Claude Code loads it when a task matches its description.

How do I install Testing in Codex?

Run `npx skills add LedgerHQ/ledger-live --skill testing -a codex`. Or copy the skill folder (.agents/skills/testing in LedgerHQ/ledger-live) into .agents/skills/testing in your project. Codex loads it when a task matches its description.

Can I use Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add LedgerHQ/ledger-live --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.

What does Testing need to run?

Going by SKILL.md and its folder, Testing needs the command-line tools its instructions call (pnpm and rg).

Does Testing access the network?

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.

Is Testing safe to install?

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.

What licence does Testing use?

Testing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Testing use?

About 1.8k tokens (SKILL.md is roughly 7.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Testing?

Skills that share tags, products or a category with Testing: Designing Tests (CloudAI-X/claude-workflow-v2, 1.4k stars), Async Test And Doc Sync (discord-php/DiscordPHP, 1.1k stars), Write Tests (grafana/synthetic-monitoring-app, 171 stars) and Robotics Testing (arpitg1304/robotics-agent-skills, 368 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Testing?

LedgerHQ (a GitHub organization) maintains it in LedgerHQ/ledger-live, which has 621 GitHub stars. The repository holds 50 skills in this directory. The repository was last updated on October 7, 2026.

Source: LedgerHQ/ledger-live on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.