@storybook/addon-svelte-csf
Version:
Allows to write stories in Svelte syntax
30 lines (25 loc) • 835 B
JavaScript
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">
{
<Button {...args} />
{/snippet}
</Story>
`,
});
await expect(extractSvelteASTNodes({ ast })).resolves.not.toThrow();
});
});