-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Open
Description
Describe the bug
If you have a component using Superforms, testing it with @storybook/addon-vitest does not work, both when running the tests on the command line and from the Storybook UI. In the interactions panel, things work as expected.
Reproduction link
https://stackblitz.com/edit/github-mvcrdt2n?file=src%2Fstories%2FButton.svelte
Reproduction steps
Using the provided StackBlitz:
- Open https://stackblitz.com/edit/github-mvcrdt2n?file=src%2Fstories%2FButton.svelte
- Run the tests either from the UI or using
vitest run.
Manual reproduction:
npm i -D sveltekit-superforms- Add import to one of your components for which you have stories with play functions:
import { superForm } from "sveltekit-superforms"; - Initialize Superforms in the
scripttag:const form = superForm({ foo: "" }); - Run your story tests
System
│ System:
│ OS: Linux 5.0 undefined
│ CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
│ Shell: 1.0 - /bin/jsh
│ Binaries:
│ Node: 20.19.1 - /usr/local/bin/node
│ Yarn: 1.22.19 - /usr/local/bin/yarn
│ npm: 10.8.2 - /usr/local/bin/npm <----- active
│ pnpm: 8.15.6 - /usr/local/bin/pnpmAdditional context
No response
dosubot and Stadly