testing-svelte

testing-svelte is a skill for Claude Code from fubits1/svelte-skills. It costs 49 tokens per session (1,272 once invoked), scanned A, original, MIT.

A workflow for testing Svelte 5 components with Vitest in a browser and Playwright, a tool for controlling browsers in tests. It requires interactive components to be tested through meaningful user actions.

In plain words
What is it for?
Use it to create or repair unit, server-rendered, and end-to-end tests, interact with buttons and forms, and verify the resulting page or data.
Why use it?
It catches failures that a render-only test misses, such as broken clicks, typing, selections, form submissions, or callback data.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the svelte-5 plugin — 7 skills shipped together

Good fit Use it to create or repair unit, server-rendered, and end-to-end tests, interact with buttons and forms, and verify the resulting page or data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fubits1/svelte-skills/testing-svelte
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add fubits1/svelte-skills --skill testing-svelte
Clone the repo
git clone --depth 1 https://github.com/fubits1/svelte-skills

Made for: Claude Code.

Or install svelte-5, the plugin that ships this one along with the rest of its 7 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for testing-svelte

README.md
[![agentmods](https://agentmods.dev/badge/skills/fubits1/svelte-skills/testing-svelte/github.svg)](https://agentmods.dev/skills/fubits1/svelte-skills/testing-svelte)
Your own site
<a href="https://agentmods.dev/skills/fubits1/svelte-skills/testing-svelte"><img src="https://agentmods.dev/badge/skills/fubits1/svelte-skills/testing-svelte/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for testing-svelte

Your own site · 80×15
<a href="https://agentmods.dev/skills/fubits1/svelte-skills/testing-svelte"><img src="https://agentmods.dev/badge/skills/fubits1/svelte-skills/testing-svelte.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,272 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00049 $0.01272
Opus 5 $0.00024 $0.00636
Sonnet 5 $0.00010 $0.00254
Haiku 4.5 $0.00005 $0.00127

Measured 10d ago against content hash bee350768a7f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

testing-svelte scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/svelte-5/skills/testing-svelte/SKILL.md · 109 lines

How it starts

The opening of the file, as written. The whole thing — 109 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Svelte Testing

Quick Start

// Client-side component test (.svelte.test.ts)
import { render } from "vitest-browser-svelte";
import { expect, test } from "vitest";
import { page } from "vitest/browser";
import Button from "./button.svelte";

test("button click increments counter", async () => {
  await render(Button);
  const button = page.getByRole("button", { name: /click me/i }); // module page
  // or from the result: const screen = await render(Button); screen.getByRole(...)

  await button.click();
  await expect.element(button).toHaveTextContent("Clicked: 1");
});

Interaction Tests Are Mandatory

Every test for an interactive component MUST include meaningful interaction. A render-only test proves the component mounts, it does NOT prove it works.

For components with inputs, autocompletes, buttons, or forms:

  1. Interact: click, type, select, submit
  2. Assert the outcome: the selected value text, the callback data content, the DOM state change
  3. Never silently skip: no if (items.length > 0) guards that skip the interaction when the precondition fails. ASSERT the precondition instead.
  4. Verify callback data: use fixture components with data-testid output divs to capture and assert what callbacks received. Checking "callback was called" is not enough; check WHAT it was called with.

Example failure: tests that "verified" autocomplete interaction by checking "a selection exists" without checking which value; this missed a bug where onChange returned objects instead of strings.

Core Principles

  • Always use locators: page.getBy*() methods, never containers
  • Multiple elements: Use .first(), .nth(), .last() to avoid strict mode violations
  • Real API objects: Test with FormData/Request, minimal mocking
  • Mock at the right seam: vi.mock for module boundaries, MSW for the network boundary. MSW is this rule applied to HTTP: keep the real component and the real fetch, swap only what crosses the wire (svelte-5:msw)

Read the full file on GitHub · 109 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 109 lines · 49 tokens per session scan A bee350768a7f

Subscribe to this mod's changes

testing-svelte is a skill published in the GitHub repository fubits1/svelte-skills (10 stars, last pushed 1mo ago), licensed MIT. It adds 49 tokens to every session and 1,272 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

frontend-testing

Comprehensive frontend testing strategy covering unit, integration, E2E, visual regression, and accessibility testing.

cosmicstack-labs/mercury-agent-skills · 23 tokens

test-implement

Implements React/TypeScript unit, integration, and browser E2E tests with the repository's configured runner, mocks, setup, and browser harness. Use when creating or completing frontend tests and generated test skeletons.

shinpr/claude-code-workflows · 48 tokens

angular-testing

Write unit and integration tests for Angular v20+ applications using Vitest or Jasmine with TestBed and modern testing patterns. Use for testing components with signals, OnPush change detection, services with inject(), and HTTP interactions. Triggers on test creation, testing signal-based components, mocking…

Kilo-Org/kilo-marketplace · 94 tokens

angular-testing

Testing Angular 18-21: TestBed, component harnesses (@angular/cdk/testing), Karma+Jasmine (default historical) vs Jest (jest-preset-angular, modern), Angular Testing Library (RTL-style). HttpClient mocking via HttpTestingController. NgRx Effects testing. Cypress / Playwright e2e. Use this skill to: Detect runner…

AratKruglik/claude-sdlc · 185 tokens

vue-testing

Testing Vue 3 SPAs: Vitest + @vue/test-utils, RTL-style alternatives, Pinia testing via createTestingPinia, composable testing, msw for network mocks, Cypress component testing, Playwright e2e. Use this skill to: Set up Vitest for Vue 3 with jsdom + @vue/test-utils. Pick mount vs shallowMount. Test components by…

AratKruglik/claude-sdlc · 155 tokens

react-testing

Testing React SPAs: React Testing Library + Vitest/Jest for components and hooks, msw for network mocks, Playwright/Cypress for e2e. Query priority, user events, async assertions, mocking patterns. Use this skill to: Pick the right runner (Vitest vs Jest) and setup. Write component tests with RTL using accessible…

AratKruglik/claude-sdlc · 154 tokens