Agent skill

Unit Testing

by podman-desktop in podman-desktop/extension-bootc

Guides writing and maintaining Vitest unit tests for the bootc extension's backend, frontend, and shared packages.

Apache-2.0Auto-check passedTesting & QA

Install Unit Testing

skills CLI
$ npx skills add podman-desktop/extension-bootc --skill unit-testing -a claude-code

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

GitHub CLI
$ gh skill install podman-desktop/extension-bootc unit-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/podman-desktop/extension-bootc.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/unit-testing .claude/skills/unit-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
unit-testing
GitHub stars
474
Token cost
~1.4k tokens
SKILL.md length
198 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
Apache-2.0

At a glance

Guides writing and maintaining Vitest unit tests for the bootc extension's backend, frontend, and shared packages.

  • Modifying .spec.ts files
  • SKILL.md covers Framework, Running Tests, Backend Test Patterns and Frontend Test Patterns, plus 4 more sections
  • Calls pnpm and npx
  • Fixing Vitest failures

What it does

Unit Testing is an agent skill from podman-desktop/extension-bootc. Guides writing and maintaining Vitest unit tests for the bootc extension's backend, frontend, and shared packages. Covers mocking @podman-desktop/api, RPC clients, Svelte stores, and Node.js modules. Triggers when creating or modifying .spec.ts files, fixing Vitest failures, or adding test coverage.

Its SKILL.md is about 1.4k 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 Svelte, Node.js, Vitest and Vite. The repository describes itself as: Support for bootable OS containers (bootc) and generating disk images. The licence is Apache-2.0.

When your agent uses it

  • Modifying .spec.ts files
  • Fixing Vitest failures
  • Adding test coverage

Example prompts

  • “Use the unit-testing skill to guide writing and maintaining Vitest unit tests for the bootc extension's backend, frontend, and shared packages”
  • “/unit-testing”

Requirements

  • Node.js

What it can do on your machine

Read from SKILL.md and the folder at commit 4230bcf. 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
    • npx

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

  • Network

    No URLs in SKILL.md. Its commands use pnpm and npx, 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

Unit Testing loads about 1.4k tokens when it runs. Until then it costs about 78 tokens; SKILL.md has 198 words of instructions outside code blocks.

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

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 podman-desktop/extension-bootc at commit 4230bcf, republished under its Apache-2.0 licence (© podman-desktop). 198 words, ~1,446 tokens.

Download SKILL.mdSave it as .claude/skills/unit-testing/SKILL.md (or your agent's skills folder).
name
unit-testing
description
Guides writing and maintaining Vitest unit tests for the bootc extension's backend, frontend, and shared packages. Covers mocking @podman-desktop/api, RPC clients, Svelte stores, and Node.js modules. Triggers when creating or modifying .spec.ts files, fixing Vitest failures, or adding test coverage.
paths
packages/backend/src/**/*.spec.ts, packages/frontend/src/**/*.spec.ts, packages/shared/src/**/*.spec.ts
argument-hint
[test-file-or-pattern]

Unit Testing for Bootc Extension

Framework

  • Vitest 4 with v8 coverage provider
  • Backend: Node.js environment, mocked @podman-desktop/api
  • Frontend: JSDOM environment, @testing-library/svelte for components
  • Shared: Node.js environment for message proxy and model tests

Running Tests

bash
pnpm test              # all packages
pnpm test:backend      # packages/backend with coverage
pnpm test:frontend     # packages/frontend with coverage
pnpm test:shared       # packages/shared with coverage

# Single file
npx vitest run packages/backend/src/build-disk-image.spec.ts

# Watch mode
npx vitest watch packages/backend/src/

Backend Test Patterns

Mocking @podman-desktop/api

The backend's vite.config.js aliases @podman-desktop/api to a mock file. Mock only the namespaces your test actually uses:

typescript
import { vi, test, expect, beforeEach, describe } from 'vitest';
import * as extensionApi from '@podman-desktop/api';

vi.mock('@podman-desktop/api', async () => ({
  // Mock only what your test needs — check existing tests for patterns:
  // grep -l "vi.mock('@podman-desktop/api'" packages/backend/src/*.spec.ts
}));

To see the full mock shape used in existing tests:

bash
grep -A 30 "vi.mock('@podman-desktop/api'" packages/backend/src/*.spec.ts | head -60
Testing Backend Functions
typescript
import { describe, test, expect, vi, beforeEach } from 'vitest';
import { buildDiskImage } from './build-disk-image';

vi.mock('@podman-desktop/api');
vi.mock('./container-utils');
vi.mock('./history');

beforeEach(() => {
  vi.clearAllMocks();
});

describe('buildDiskImage', () => {
  test('should create build container with correct volumes', async () => {
    // Arrange
    const buildInfo = {
      id: 'test-id',
      image: 'quay.io/test/image',
      tag: 'latest',
      type: ['qcow2'] as BuildType[],
      folder: '/output',
      // ...
    };

    // Act
    await buildDiskImage(buildInfo);

    // Assert
    expect(containerEngine.createContainer).toHaveBeenCalledWith(
      expect.anything(),
      expect.objectContaining({
        Image: expect.stringContaining('bootc-image-builder'),
      }),
    );
  });
});
Mocking Node.js Modules
typescript
import { vi } from 'vitest';

vi.mock('node:fs', async () => ({
  promises: {
    mkdir: vi.fn(),
    readFile: vi.fn(),
    writeFile: vi.fn(),
  },
  existsSync: vi.fn(),
}));

vi.mock('node:child_process', async () => ({
  exec: vi.fn(),
}));

Frontend Test Patterns

Component Testing with @testing-library/svelte
typescript
import { vi, test, expect, beforeEach } from 'vitest';
import { render, screen, fireEvent } from '@testing-library/svelte';
import '@testing-library/jest-dom/vitest';
import MyComponent from './MyComponent.svelte';

// Mock the RPC client
vi.mock('/@/api/client', async () => ({
  bootcClient: {
    listBootcImages: vi.fn().mockResolvedValue([]),
    buildImage: vi.fn(),
  },
  rpcBrowser: {
    subscribe: vi.fn().mockReturnValue({ unsubscribe: vi.fn() }),
  },
}));

test('renders heading', async () => {
  render(MyComponent, { props: { imageName: 'test' } });
  expect(screen.getByText('Build Disk Image')).toBeInTheDocument();
});

test('clicking build button triggers build', async () => {
  render(MyComponent);
  const buildButton = screen.getByRole('button', { name: 'Build' });
  await fireEvent.click(buildButton);
  expect(bootcClient.buildImage).toHaveBeenCalled();
});
Mocking Svelte Stores
typescript
import { vi } from 'vitest';
import { readable } from 'svelte/store';

vi.mock('/@/stores/imageInfo', async () => ({
  imageInfos: readable([{ Id: 'abc123', RepoTags: ['quay.io/test:latest'], Labels: { 'containers.bootc': '' } }]),
}));
Path Aliases in Tests

Frontend tests resolve /@/ to packages/frontend/src/ and /@shared/ to packages/shared/ via Vite config. Use these aliases in mocks:

typescript
vi.mock('/@/api/client'); // → packages/frontend/src/api/client
vi.mock('/@shared/src/models/bootc'); // → packages/shared/src/models/bootc

Shared Package Tests

MessageProxy Tests
typescript
import { test, expect, vi } from 'vitest';
import { RpcBrowser, RpcExtension } from './MessageProxy';

test('RPC call resolves with result', async () => {
  // Test the RPC proxy mechanism
});

Test File Naming

  • Test files: *.spec.ts colocated with source files
  • Example: build-disk-image.ts → build-disk-image.spec.ts

Coverage

Coverage reports are generated in lcov and text format:

bash
pnpm test:backend   # generates packages/backend/coverage/
pnpm test:frontend  # generates packages/frontend/coverage/

Common Issues

"Cannot find module @podman-desktop/api"

The mock alias is configured in packages/backend/vite.config.js. If you see this error, ensure the test file is being run from the correct package.

"Not a Svelte component"

The test environment needs the Svelte vite plugin. Frontend tests use the config from packages/frontend/vite.config.js which includes @sveltejs/vite-plugin-svelte.

Test Retries

Frontend tests retry failed tests 2x (configured in packages/frontend/vite.config.js). Backend tests do not retry.

© podman-desktop, 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

Files

Just SKILL.md in .agents/skills/unit-testing of podman-desktop/extension-bootc.

Open the folder on GitHubat commit 4230bcf

Compare with similar skills

Unit 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.

Unit Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Unit Testing this skillpodman-desktop/extension-bootc474—~1.4kAutomated safety check: PassApache-2.0
Vitestsupabase/supabase111k12 repos~1.1kAutomated safety check: PassApache-2.0
Svelte Testingspences10/sveltest113—~579Automated safety check: PassMIT
Test Coveragescott-fryxell/brayness124—~1.6kAutomated safety check: PassMIT
Frontend Testingnightscout/nocturne139—~1.7kAutomated safety check: PassNone
Testing Livekit Agentslivekit-examples/agent-starter-python2641 repos~1.9kAutomated safety check: PassMIT

Similar skills

  • Vitest

    supabase/supabase

    Official

    Vitest API and config reference (Jest-compatible) — mocking with vi., spies, fake timers, coverage configuration, fixtures, snapshots, and test filtering.

    111k GitHub starsUsed in 12 repos~1.1k tokens
    Testing & QAAuto-check passed
  • Svelte Testing

    spences10/sveltest

    Fix and create Svelte 5 tests with vitest-browser-svelte and Playwright.

    113 GitHub stars~579 tokensUpdated today
    Testing & QAAuto-check passed
  • Test Coverage

    scott-fryxell/brayness

    Write Vitest specs for Vue 3 JavaScript (Vite Plus, happy-dom, @vue/test-utils) and analyze V8 coverage + Fallow health to prioritize test-first refactors.

    124 GitHub stars~1.6k tokensUpdated 10 days ago
    Testing & QAAuto-check passed
  • Frontend Testing

    nightscout/nocturne

    A skill your agent uses when writing, editing, or reviewing frontend tests in the Nocturne Web app (src/Web/packages/app).

    139 GitHub stars~1.7k tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • Testing Livekit Agents

    livekit-examples/agent-starter-python

    Writes turn-level tests for a LiveKit agent in the user's normal test suite: pytest (Python) or Vitest (Node.js).

    264 GitHub starsUsed in 1 repo~1.9k tokens
    Testing & QAAuto-check passed
  • Testing Fundamentals

    DanielPodolsky/ownyourcode

    Guides test strategy for unit, integration, and E2E testing.

    290 GitHub starsUsed in 1 repo~1.5k tokens
    Testing & QAAuto-check passed

More from podman-desktop/extension-bootc

  • Backend API

    podman-desktop/extension-bootc

    Guides backend development with @podman-desktop/api and the bootc extension's RPC system.

    474 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Extension Development

    podman-desktop/extension-bootc

    Guides end-to-end feature development in the bootc Podman Desktop extension.

    474 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Playwright Testing

    podman-desktop/extension-bootc

    Guides writing and maintaining Playwright E2E tests for the bootc Podman Desktop extension.

    474 GitHub stars~2.6k tokensUpdated today
    Auto-check passed
  • Svelte UI Design

    podman-desktop/extension-bootc

    Guides designing and building Svelte 5 UI components in the bootc extension.

    474 GitHub stars~1.3k tokensUpdated today
    Auto-check passed

Categories

Questions about Unit Testing

What does Unit Testing do?

Guides writing and maintaining Vitest unit tests for the bootc extension's backend, frontend, and shared packages. Unit Testing is an agent skill from podman-desktop/extension-bootc. Guides writing and maintaining Vitest unit tests for the bootc extension's backend, frontend, and shared packages.

When should I use Unit Testing?

Unit Testing fits situations like: modifying .spec.ts files; fixing Vitest failures; adding test coverage.

How do I install Unit Testing in Claude Code?

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

How do I install Unit Testing in Codex?

Run `npx skills add podman-desktop/extension-bootc --skill unit-testing -a codex`. Or copy the skill folder (.agents/skills/unit-testing in podman-desktop/extension-bootc) into .agents/skills/unit-testing in your project. Codex loads it when a task matches its description.

Can I use Unit 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 podman-desktop/extension-bootc --skill unit-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/unit-testing, .gemini/skills/unit-testing, .github/skills/unit-testing and .opencode/skills/unit-testing in your project.

What does Unit Testing need to run?

Going by SKILL.md and its folder, Unit Testing needs the command-line tools its instructions call (pnpm and npx). Our summary lists: Node.js.

Does Unit Testing access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Unit 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 Unit Testing use?

Unit 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.

How many tokens does Unit Testing use?

About 1.4k tokens (SKILL.md is roughly 5.8k 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 Unit Testing?

Skills that share tags, products or a category with Unit Testing: Vitest (supabase/supabase, 111k stars), Svelte Testing (spences10/sveltest, 113 stars), Test Coverage (scott-fryxell/brayness, 124 stars) and Frontend Testing (nightscout/nocturne, 139 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Unit Testing?

podman-desktop (a GitHub organization) maintains it in podman-desktop/extension-bootc, which has 474 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 8, 2026.

Source: podman-desktop/extension-bootc on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.