-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storybook pulls my tests #56
Comments
@JesusTheHun what error are you seeing? |
|
@soulsam480 do you have any thoughts on why vite might be trying to process these? @JesusTheHun, what version of storybook-builder-vite are you using? If not the latest, could you try it out? |
@JesusTheHun do you have proper types for testing-library and have it as a dev dependency? |
I'm using In my quest I just started to use
|
Ah, i got it, may be an issue with custom |
It's not a custom path. It's at the root of the project. I have 3 different |
Right now what seems the closest to work is : async viteFinal(config) {
config.plugins.push(tsconfigPaths());
config.optimizeDeps.exclude = ['@testing-library/react', '@babel/runtime', 'format-js']
return config;
}, |
Ok I finally got it working. I was all wrong. Oh boy. I was wrong. Turns out my main {
"include": [
"src",
"typings"
],
"exclude": [
"src/**/*.spec.*",
"**/node_modules",
"**/.*/"
],
} Turns out to build my stories I use some utils I created. Those utils were located in a file along with other utils. Those other utils were using and therefore importing So after splitting my utils I updated my {
"include": [
"src",
"typings"
],
"exclude": [
"src/**/*.spec.*",
"src/setupTests.ts",
"src/utils-dev/tests-utils.tsx",
"**/node_modules",
"**/.*/"
],
} My async viteFinal(config) {
config.plugins.push(tsconfigPaths(), svgr()); // tsconfigPaths() is for aliases, nothing to do with our issue
return config;
}, I hope I gave enough details so people struggling with the same issue can fix it more quickly than I did :) |
Thanks for the thorough followup, @JesusTheHun! |
I'm attempting to migrate from the default builder to vite.
For some reason, storybook shows some error about
@testing-library/dom
andpretty-format
. They should be not there in the first place because those are testing only libraries. I tried to include or exclude them fromoptimizeDeps
without success.I don't understand why it tries to pull them. Maybe it pulls all the tsconfig files, I don't know. I have 3
tsconfig
files at the root of my project, one for dev, one for tests and one for eslint.Edit : I talked about this issue here : testing-library/dom-testing-library#985
The text was updated successfully, but these errors were encountered: