Skip to content
Back to skills

Testing Ink

ASecurity

Use when writing or modifying tests for Ink (terminal UI) components.

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 10, 2026
ai-agentstypescriptreacttesting

Works with

  • terminal

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add LandonSchropp/agent-toolkit --skill testing-ink --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Testing Ink?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Testing Ink
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/landonschropp-testing-ink/badge)](https://www.skillsdirectory.com/skills/landonschropp-testing-ink)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: testing-ink
description: Use when writing or modifying tests for Ink (terminal UI) components.
---

# Testing Ink Components

Use `render` from `ink-testing-library`, not `@testing-library/react`. Ink has its own renderer, so the DOM library can't reach it.

```tsx
import { render } from "ink-testing-library";

const { lastFrame, frames, rerender } = render(<MyComponent />);
expect(lastFrame()).toContain("expected text");
```

- `lastFrame()`: the most recent rendered terminal frame as a string.
- `frames`: the full array of frames in render order.
- `rerender(<MyComponent prop={next} />)`: re-render with new props.

## Testing hooks in a Bun project

Bun has no DOM, so testing a hook (via `ls-typescript:testing-react`) needs DOM globals registered. Call `@happy-dom/global-registrator` before any `@testing-library/react` import, so the DOM is present when React DOM loads.

```tsx
import { GlobalRegistrator } from "@happy-dom/global-registrator";

GlobalRegistrator.register();

import { renderHook } from "@testing-library/react";
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.