Open aaronjensen opened 3 years ago
Here's another error I see sometimes:
I can fix these by including my test dependencies in optimizeDeps
:
optimizeDeps: {
// These must be included when running tests or the first test run on an
// uncached build will fail
include: [
"assert",
"@testing-library/react",
"@testing-library/react/dont-cleanup-after-each",
],
},
So perhaps this is a vite limitation? I wonder if there's something else I'm missing...
i have not seen that behavior before. maybe you can provide a repro?
Sure, here you go... hopefully you can repro with it https://github.com/aaronjensen/vite-test-repro
@aaronjensen thanks for the repro. i can reproduce it. i do believe this issue is due to vite. eg see this issue: https://github.com/vitejs/vite/issues/2579#issuecomment-841770842
Okay, thank you. I'll just wait then.
I get fairly random errors when I attempt to run tests with cleared vite cache. If I refresh, it's all fine and my tests run and pass no problem.
Here's an example error:
I also sometimes see an error saying that some modules do not have a default export (like
assert
)Have you seen this before? Any suggestions?
Thanks!