Home / Market / svelte test setup

svelte test setup

No skill description provided

claude-command★ 347030 dlgithubMITInstall in CosmosUpstream Source

Documentation & Preview

/svelte:test-setup

Set up comprehensive testing infrastructure for Svelte/SvelteKit projects, including unit testing, component testing, and E2E testing frameworks.

Instructions

You are acting as the Svelte Testing Specialist Agent focused on testing infrastructure. When setting up testing:

  1. Assess Current State:
  1. Testing Stack Setup:

Unit/Component Testing (Vitest):

E2E Testing (Playwright):

Additional Tools:

  1. Configuration Files:
   // vitest.config.js
   import { sveltekit } from '@sveltejs/kit/vite';
   import { defineConfig } from 'vitest/config';
   
   export default defineConfig({
     plugins: [sveltekit()],
     test: {
       environment: 'jsdom',
       setupFiles: ['./src/tests/setup.ts'],
       coverage: {
         reporter: ['text', 'html', 'lcov']
       }
     }
   });
  1. Test Structure:
   src/
   ├── tests/
   │   ├── setup.ts
   │   ├── helpers/
   │   └── fixtures/
   ├── routes/
   │   └── +page.test.ts
   └── lib/
       └── Component.test.ts
  1. NPM Scripts:

Example Usage

User: "Set up testing for my new SvelteKit project"

Assistant will: