UNPKG

@storybook/addon-svelte-csf

Version:
23 lines (22 loc) 889 B
import { print } from 'esrap'; import { describe, it } from 'vitest'; import { createVariableFromRuntimeStoriesCall } from './create-variable-from-runtime-stories-call.js'; describe(createVariableFromRuntimeStoriesCall.name, () => { it('creates a variable correctly', ({ expect }) => { const stringified = print(createVariableFromRuntimeStoriesCall({ storiesFunctionDeclaration: { type: 'FunctionDeclaration', id: { type: 'Identifier', name: 'Example_stories', }, body: { type: 'BlockStatement', body: [], }, params: [], }, })).code; expect(stringified).toMatchInlineSnapshot(`"const $__stories = createRuntimeStories(Example_stories, $__meta);"`); }); });