Agent skill

Testing

by live-codes in live-codes/livecodes

Write and run automated tests with Jest and Testing Library in the browser.

MITAuto-check passedTesting & QA

Install Testing

skills CLI
$ npx skills add live-codes/livecodes --skill testing -a claude-code

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

GitHub CLI
$ gh skill install live-codes/livecodes 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/live-codes/livecodes.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/livecodes/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
1.5k
Token cost
~1.9k tokens
SKILL.md length
250 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
MIT

At a glance

Write and run automated tests with Jest and Testing Library in the browser.

  • Tasks that involve Unit testing
  • SKILL.md covers Setup, Core Patterns, Test Panel Controls and Common Mistakes, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Testing is an agent skill from live-codes/livecodes. Write and run automated tests with Jest and Testing Library in the browser. Import code from script editor, use watch mode, and run tests programmatically. Load this skill when writing tests for playground code or running tests via SDK.

Its SKILL.md is about 1.9k 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. It works with Testing Library and Jest. The repository describes itself as: A Code Playground That Just Works! The licence is MIT.

When your agent uses it

  • Tasks that involve Unit testing

Example prompts

  • “/testing”

What it can do on your machine

Read from SKILL.md and the folder at commit 5754e89. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript).

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

  • Network

    No URLs in SKILL.md.

    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.9k tokens when it runs. Until then it costs about 61 tokens; SKILL.md has 250 words of instructions outside code blocks.

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

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 live-codes/livecodes at commit 5754e89, republished under its MIT licence (© live-codes). 250 words, ~1,896 tokens.

Download SKILL.mdSave it as .claude/skills/testing/SKILL.md (or your agent's skills folder).
name
testing
description
Write and run automated tests with Jest and Testing Library in the browser. Import code from script editor, use watch mode, and run tests programmatically. Load this skill when writing tests for playground code or running tests via SDK.
metadata.type
core
metadata.library
livecodes
metadata.library_version
0.13.0
sources
live-codes/livecodes:docs/docs/features/tests.mdx

LiveCodes — Write and Run Tests

LiveCodes includes Jest and Testing Library for automated testing in the browser. Tests run against the result page in real-time.

Setup

javascript
import { createPlayground } from 'livecodes';

// Project with tests
createPlayground('#container', {
  template: 'jest', // Jest starter template
  params: { tests: 'open' }, // Show tests panel
});

// Custom test configuration
createPlayground('#container', {
  config: {
    activeEditor: 'script',
    script: {
      language: 'javascript',
      content: `
export function add(a, b) {
  return a + b;
}

export function greet(name) {
  return 'Hello, ' + name;
}
      `,
    },
    tests: {
      language: 'javascript',
      content: `
import { add, greet } from './script';

describe('add', () => {
  test('adds numbers', () => {
    expect(add(1, 2)).toBe(3);
  });

  test('handles negatives', () => {
    expect(add(-1, -2)).toBe(-3);
  });
});

describe('greet', () => {
  test('greets by name', () => {
    expect(greet('World')).toBe('Hello, World');
  });
});
      `,
    },
  },
  params: { tests: 'open' },
});

Core Patterns

Test exports from script editor
javascript
// Script editor (script.js)
export default function greet(name) {
  return 'Hello, ' + name;
}

export const add = (a, b) => a + b;

// Also available in global scope
window.multiply = (a, b) => a * b;
javascript
// Tests editor
import greet, { add } from './script'; // Relative import, no extension

describe('imports', () => {
  test('greet', () => {
    expect(greet('World')).toBe('Hello, World');
  });

  test('add', () => {
    expect(add(1, 2)).toBe(3);
  });
});

describe('globals', () => {
  test('multiply', () => {
    expect(window.multiply(2, 3)).toBe(6);
  });
});
Use Testing Library
javascript
// React Testing Library
import { render, screen, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom';
import userEvent from '@testing-library/user-event';

test('button click', async () => {
  render(<MyComponent />);
  await userEvent.click(screen.getByText('Click me'));
  expect(screen.getByText('Clicked')).toBeInTheDocument();
});

// DOM Testing Library
import { getByText, waitFor } from '@testing-library/dom';

test('element appears', async () => {
  document.body.innerHTML = '<div id="root"></div>';
  // ... render something
  await waitFor(() => {
    expect(getByText(document.body, 'Loaded')).toBeTruthy();
  });
});
Run tests programmatically via SDK
javascript
const playground = await createPlayground('#container', {
  config: {
    /* ... */
  },
});

// Run tests and get results
const { results } = await playground.runTests();

results.forEach((result) => {
  console.log(result.status); // 'pass', 'fail', or 'skip'
  console.log(result.testPath); // ['describe', 'it']
  console.log(result.duration); // milliseconds
  console.log(result.errors); // string[] of error messages
});

// Watch for test results
playground.watch('tests', ({ results, error }) => {
  if (error) {
    console.error('Test error:', error);
    return;
  }
  const passed = results.filter((r) => r.status === 'pass');
  console.log(`${passed.length} tests passed`);
});
Use Jest globals directly
javascript
// Jest globals available without import
describe('my tests', () => {
  test('passes', () => {
    expect(1 + 1).toBe(2);
  });

  test('asynchronous', async () => {
    const result = await someAsyncFunction();
    expect(result).toBe('expected');
  });

  test.skip('skipped', () => {
    // Not run
  });

  test.only('run only this', () => {
    // Only this test runs
  });
});

// Lifecycle hooks
beforeAll(() => {
  /* runs once before all tests */
});
afterAll(() => {
  /* runs once after all tests */
});
beforeEach(() => {
  /* runs before each test */
});
afterEach(() => {
  /* runs after each test */
});

// Mocks
jest.fn();
jest.mocked(obj);
jest.spyOn(obj, 'method');
Use Chai assertions (alternative)
javascript
import { assert } from 'chai';

describe('with Chai', () => {
  test('assertions', () => {
    assert.equal(1 + 1, 2);
    assert.isArray([1, 2, 3]);
    assert.include([1, 2, 3], 2);
  });
});

Test Panel Controls

In the standalone app or visible tests panel:

  • Run button: Run tests (shortcut: Ctrl/Cmd + Alt + T)
  • Watch toggle: Auto-run tests on code change
  • Reset button: Clear test results
  • Edit button: Open test editor (not available in embeds)

Common Mistakes

HIGH Script errors prevent tests from loading

Wrong:

javascript
// Script editor has syntax error
export function add(a, b) {
  return a +  // Syntax error - missing operand
}

// Tests editor - tests never run because script failed
import { add } from './script';
test('add', () => expect(add(1, 2)).toBe(3));

Understanding:

javascript
// Tests run against the result page
// Script errors prevent the page from loading
// Always ensure script compiles before testing

// Check the console for script errors
// Fix script errors before writing tests

Tests are added to the result page. Script errors (import errors, syntax errors) prevent the result page from loading, which prevents tests from running.

Source: docs/docs/features/tests.mdx — Example section

MEDIUM Import path must be relative without extension

Wrong:

javascript
import { add } from 'script'; // Missing ./
import { add } from './script.js'; // Has extension

Correct:

javascript
import { add } from './script'; // Relative import, no extension

When importing from the script editor in tests, use relative imports without file extensions.

Source: docs/docs/features/tests.mdx — Importing Code section

Supported Jest Features

FeatureSupport
describe, test, itFull support
xtest, xit, fitSkip/only tests
xdescribe, fdescribeSkip/only suites
beforeAll, afterAllLifecycle hooks
beforeEach, afterEachLifecycle hooks
expectFull matchers
jest.fn(), jest.mocked()Function mocks
jest.spyOn()Spy on methods
jest.replaceProperty()Property replacement

Supported Testing Libraries

LibraryImport
DOM Testing Libraryimport { getByText, waitFor } from '@testing-library/dom'
React Testing Libraryimport { render, screen } from '@testing-library/react'
jest-domimport '@testing-library/jest-dom'
user-eventimport userEvent from '@testing-library/user-event'
Chaiimport { assert } from 'chai'

Tests run in the browser using Jest. Libraries are automatically available — no import maps needed for testing libraries.

© live-codes, 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/livecodes/testing of live-codes/livecodes.

Open the folder on GitHubat commit 5754e89

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 skilllive-codes/livecodes1.5k—~1.9kAutomated safety check: PassMIT
Jest Testing PatternsChrisWiles/claude-code-showcase6.1k7 repos~1.5kAutomated safety check: PassNone
Write Testsgrafana/synthetic-monitoring-app171—~1.2kAutomated safety check: PassAGPL-3.0
Playwright Testingchongdashu/vibejam-starter-pack149—~2.1kAutomated safety check: PassNone
Unit TestsKhan/wonder-blocks163—~4.2kAutomated safety check: PassMIT
React Testinggetsentry/sentry45k—~2.2kAutomated safety check: PassCustom licence

Similar skills

  • Jest Testing Patterns

    ChrisWiles/claude-code-showcase

    Jest patterns for React Native style tests: TDD discipline, mock factory functions, module and GraphQL hook mocking, custom render helpers and anti-patterns to avoid.

    6.1k GitHub starsUsed in 7 repos~1.5k tokens
    Testing & QAAuto-check passed
  • 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
  • Playwright Testing

    chongdashu/vibejam-starter-pack

    Plan, implement, and debug frontend tests: unit/integration/E2E/visual/a11y.

    149 GitHub stars~2.1k tokensUpdated 5 mo ago
    Testing & QAAuto-check passed
  • Unit Tests

    Khan/wonder-blocks

    Jest + React Testing Library best practices for Wonder Blocks unit tests.

    163 GitHub stars~4.2k tokensUpdated today
    Testing & QAAuto-check passed
  • React Testing

    getsentry/sentry

    Official

    Write and review React/TypeScript tests for Sentry's frontend using Jest and React Testing Library.

    45k GitHub stars~2.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Testing

    redis/RedisInsight

    Official

    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…

    8.9k GitHub stars~3.3k tokensUpdated 2 days ago
    Testing & QAAuto-check passed

More from live-codes/livecodes

All 15 skills in this repo
  • Language Support

    live-codes/livecodes

    Work with 90+ supported languages, compilers, CSS processors, and WASM-compiled languages for markup, style, and script editors.

    1.5k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Configuration

    live-codes/livecodes

    Configure playground behavior through Config object, query parameters, EmbedOptions, editor settings, processors, external resources, and custom settings.

    1.5k GitHub stars~4.5k tokensUpdated today
    Auto-check passed
  • Display Modes

    live-codes/livecodes

    Configure how the playground is displayed: full, focus, simple, lite, editor, codeblock, and result modes.

    1.5k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Framework Wrappers

    live-codes/livecodes

    Use SDK with React, Vue, Svelte, Solid, Preact, and Web Components.

    1.5k GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Getting Started

    live-codes/livecodes

    Quick start for standalone app at livecodes.io, embedding playgrounds with CDN or npm, and self-hosting basics.

    1.5k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Gh Action

    live-codes/livecodes

    Use the "Preview in LiveCodes" GitHub Action to generate preview playground links for pull request code changes.

    1.5k GitHub stars~1.8k tokensUpdated today
    Auto-check passed

Categories

Questions about Testing

What does Testing do?

Write and run automated tests with Jest and Testing Library in the browser. Testing is an agent skill from live-codes/livecodes. Write and run automated tests with Jest and Testing Library in the browser.

When should I use Testing?

Testing fits situations like: tasks that involve Unit testing.

How do I install Testing in Claude Code?

Run `npx skills add live-codes/livecodes --skill testing -a claude-code`. Or copy the skill folder (.agents/skills/livecodes/testing in live-codes/livecodes) 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 live-codes/livecodes --skill testing -a codex`. Or copy the skill folder (.agents/skills/livecodes/testing in live-codes/livecodes) 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 live-codes/livecodes --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?

SKILL.md names no scripts, command-line tools or credentials: Testing is instructions for the agent only.

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.9k tokens (SKILL.md is roughly 7.6k 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: Jest Testing Patterns (ChrisWiles/claude-code-showcase, 6.1k stars), Write Tests (grafana/synthetic-monitoring-app, 171 stars), Playwright Testing (chongdashu/vibejam-starter-pack, 149 stars) and Unit Tests (Khan/wonder-blocks, 163 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Testing?

live-codes (a GitHub organization) maintains it in live-codes/livecodes, which has 1,512 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 6, 2026.

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