Open PeterDraex opened 3 weeks ago
A PR would be welcome
Astro uses vite-plugin-solid
:
To properly set this up in Astro, you should be using the getViteConfig
API and you should add the Solid integration in your Astro config.
However, after doing those, it still doesn't seem to work. I found that it's because of this line:
Where ssr: true
is causing problems for some reason. Personally I'm not sure why vite-plugin-solid
needed the ssr
option in the first place (and dev
too). But we probably have to workaround this ourselves at the meantime. I think we can not set ssr: true
if process.env.VITEST
is true
to fix this.
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
The new SolidJS documentation has a tutorial how to setup testing. I followed it and it resulted in this error: FAIL src/components/Counter.test.jsx [ src/components/Counter.test.jsx ] TypeError: Cannot read properties of undefined (reading 'Symbol(Node prepared with document state workarounds)')
After a lot of trial/error, I think it's not working because astro doesn't use the official vite-plugin-solid package for integration. I found a previous mention that this was considered, so I wanted to bring it to attention as it would fix the testing (I think).
What's the expected result?
Passing test
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-pqy8j7-m47wdw?file=src%2Fpages%2Findex.astro
cc @bluwy