Webpack 4-based builder for Storybook that provides framework-agnostic build engine for preview iframe compilation and bundling.
91
A testing utility library that reuses UI component stories in unit tests, enabling snapshot testing and component validation outside of Storybook's UI.
Compose story objects with custom arguments and parameters for testing purposes.
{ label: 'Click me', variant: 'primary' }, composing it with args { variant: 'secondary' } produces a story with merged args { label: 'Click me', variant: 'secondary' } @testRender composed stories to produce renderable elements for snapshot and visual testing.
Load and prepare all stories from a story file for use in test environments.
@generates
import type { StoryContext, Args, Parameters } from '@storybook/types';
/**
* Represents a story that can be composed and rendered in tests
*/
export interface ComposableStory<TArgs = Args> {
(args?: Partial<TArgs>): any;
storyName: string;
id: string;
args: TArgs;
parameters: Parameters;
}
/**
* Compose a story with custom args, decorators, and parameters
* @param story - The original story function or object
* @param meta - The story metadata (default export from CSF file)
* @param overrides - Optional overrides for args and parameters
* @returns A composable story that can be called with args to render
*/
export function composeStory<TArgs = Args>(
story: any,
meta: any,
overrides?: {
args?: Partial<TArgs>;
parameters?: Parameters;
}
): ComposableStory<TArgs>;
/**
* Compose all stories from a CSF module for testing
* @param csfModule - The imported CSF module (default + named exports)
* @returns An object with all stories as composable functions
*/
export function composeStories<T = any>(csfModule: any): Record<string, ComposableStory>;
/**
* Set the project annotations (decorators, parameters, etc.) for all composed stories
* @param annotations - Project-level configuration from preview.js
*/
export function setProjectAnnotations(annotations: {
decorators?: any[];
parameters?: Parameters;
globalTypes?: any;
[key: string]: any;
}): void;Provides React-specific story rendering and composition utilities. Use the portable stories API from this package.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-storybook--builder-webpack4evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10