You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the preview-head.js or the middleware.js file in your .storybook folder doesn't automatically injected into the Vitest environment. Users would have to manually provide scripts in preview-head.js using the browser.testerscripts configuration and to import CSS files manually in their vitest.setup.ts file.
Additionally, the previewHead hook in .storybook/main.js is ignored as well and isn't considered.
Tests do not consider the scripts set up in .storybook/preview-head.js, which sets up a global.js script and an external jquery script to provide the global $ variable. Additionally, the previewHead preset in .storybook/main.js is ignored as well as the proxying of a URL via .storybook/middleware.js.
The text was updated successfully, but these errors were encountered:
I don't think we should put effort into supporting middleware.js. I wouldn't expect it to be easy to do, it's an undocumented functionality, and I personally think that users should configure it in their Vite config if they need it.
Describe the bug
Currently, the
preview-head.js
or themiddleware.js
file in your.storybook
folder doesn't automatically injected into the Vitest environment. Users would have to manually provide scripts inpreview-head.js
using the browser.testerscripts configuration and to import CSS files manually in theirvitest.setup.ts
file.Additionally, the
previewHead
hook in.storybook/main.js
is ignored as well and isn't considered.Reproduction steps
git clone https://github.com/pkp/ui-library.git
pnpm install
pnpm dlx [email protected] add @storybook/experimental-addon-test
.storybook/preview-head.js
, which sets up aglobal.js
script and an external jquery script to provide the global$
variable. Additionally, thepreviewHead
preset in.storybook/main.js
is ignored as well as the proxying of a URL via.storybook/middleware.js
.The text was updated successfully, but these errors were encountered: