testing-svelte

testing-svelte is a skill for Claude Code from fubits1/svelte-skills. It costs 51 tokens per session (1,994 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 — 8 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 8 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 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,994 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.00051 $0.01994
Opus 5.5 $0.00020 $0.00798
Sonnet 5.5 $0.00010 $0.00399
Haiku 4.5 $0.00005 $0.00199

Measured 12d ago against content hash 26ea8d84c6c1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 12d 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 · 81 lines

How it starts

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

Svelte Testing

Quick Start

// browser component test
import { render } from "vitest-browser-svelte";
import { expect, test } from "vitest";
import { page } from "vitest/browser";
// button.svelte: <button onclick={() => count++}>Clicked: {count}</button>
import Button from "./button.svelte";

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

  await button.click();
  await expect.element(button).toHaveTextContent("Clicked: 1"); // exact full text
});

Interaction Tests Are Mandatory

Every test for an interactive component (inputs, autocompletes, buttons, forms) MUST interact with it and assert the result: a render-only test proves only that the component mounts.

  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: assert the precondition instead of guarding it with an if (items.length > 0) that skips the interaction when it fails
  4. Verify callback data: capture what a callback received and assert it; a fixture component that renders the payload into an output element works (give it an accessible name, or comment why a test id is used). "The callback was called" misses an onChange that passes objects instead of strings

Core Principles

  • Prefer locators: page.getBy*() methods first. A raw querySelector or data-testid needs a one-line comment saying why no accessible locator works (svelte-5:vitest query rule)
  • Multiple elements: use .first(), .nth(), .last() to avoid strict mode violations
  • Real API objects: test with FormData and Request, with 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)
  • vi.mock / vi.hoisted / vi.unmock at the top level only: inside describe, test, or a function they throw in Vitest 5 (was defined outside of the module's top level scope). vi.doMock may go anywhere. Factories, SvelteKit $app/* stubs, component swaps: svelte-5:vitest mocking reference

Read the full file on GitHub · 81 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. 12d ago Changed · -6 lines · +2 tokens per session 26ea8d84c6c1
  2. 1mo ago Changed · -22 lines 1df3d59399c3
  3. 2mo 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 12d ago), licensed MIT. It adds 51 tokens to every session and 1,994 once invoked, about $0.0002 per session on Opus 5.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

testing-svelte compared with skills from other repositories

testing-svelte next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
testing-sveltefubits1/svelte-skillsSkill1012d agoMITA51Claude Code
test-masterJeffallan/claude-skillsSkill12k7d agoMITA104Claude Code
axiom-testingCharlesWiltgen/AxiomSkill1.3kyesterdayMITA38Claude Code
test-generatorrshankras/claude-code-apple-skillsSkill8642d agoMITA33Claude Code
testing-blocksadobe/skillsSkill319yesterdayApache-2.0A61Claude Code
designing-testsCloudAI-X/claude-workflow-v2Skill1.4k1mo agoMITA48Claude Code
test-automation-expertcuriositech/some_claude_skillsSkill263yesterdayMITA133Claude Code