sfnext-testing
Installation
SKILL.md
Testing Skill
This skill covers testing patterns in Storefront Next — Vitest for unit tests and Storybook for component stories, interaction tests, and accessibility validation.
Unit Tests (Vitest)
Test files live alongside source files with .test.ts or .test.tsx extension:
// src/components/product-card/product-card.test.tsx
import { describe, it, expect, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
import { ProductCard } from './product-card';
import { mockProduct } from '@/test-utils/mocks';