UNPKG

@storybook/addon-svelte-csf

Version:
30 lines (25 loc) 835 B
import { describe, it } from 'vitest'; import { extractSvelteASTNodes } from './nodes.js'; import { getSvelteAST } from '../../ast.js'; describe(extractSvelteASTNodes.name, () => { it('works with a simple example', async ({ expect }) => { const ast = getSvelteAST({ code: ` <script module> import { defineMeta } from "@storybook/addon-svelte-csf" import Button from "./Button.svelte"; const { Story, meta } = defineMeta({ component: Button, }); </script> <Story name="Default" /> <Story name="Playground"> {#snippet template(args)} <Button {...args} /> {/snippet} </Story> `, }); await expect(extractSvelteASTNodes({ ast })).resolves.not.toThrow(); }); });