UNPKG

@stacksjs/stx

Version:

A performant UI Framework. Powered by Bun.

58 lines 1.26 kB
import type { StoryContext } from './types'; /** * Run visual regression tests */ export declare function runVisualTests(ctx: StoryContext, options?: TestOptions): Promise<TestResult>; /** * Update all snapshots */ export declare function updateSnapshots(ctx: StoryContext, options?: TestOptions): Promise<number>; /** * Format test results for console output */ export declare function formatTestResults(result: TestResult): string; /** * Run accessibility tests on stories */ export declare function runA11yTests(ctx: StoryContext, _options?: TestOptions): Promise<TestResult>; /** * Test options */ export declare interface TestOptions { update?: boolean filter?: string[] threshold?: number snapshotDir?: string } /** * Test result */ export declare interface TestResult { total: number passed: number failed: number new: number failures: TestFailure[] duration: number } /** * Test failure details */ export declare interface TestFailure { storyId: string variantId: string component: string message: string diffPath?: string difference?: number } /** * Snapshot metadata */ export declare interface SnapshotMeta { storyId: string variantId: string component: string timestamp: number hash: string }