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
… errors.
The main issue is that in some components there is some styling declared as <style jsx>, but when running the tests for these components we get the warning
“Warning: Received `true` for a non-boolean attribute `jsx`”.
If we change to <style jsx = “true”>, the warning is fixed but then we get a compile error:
Type error: Type 'string' is not assignable to type 'boolean | undefined'.
I do not understand completely why not setting this variable is giving the warning, but some explanation and suggestions for fixes are provided in the following links:
vitejs/vite#6136vercel/styled-jsx#838https://github.com/vercel/styled-jsx#rendering-in-tests
I tried all of them, but they did not fix the warning. However, in the end, by just removing the jsx tag, it seems to work ( the app compiles and not warnings).
When I run my tests in Vitest using the jsdom environment I receive the error:
According to the readme, this error is fixed with
styled-jsx/babel-test
, but it is not working for me.vitest.config.ts
Sample.test.tsx
.babelrc
Environment
The text was updated successfully, but these errors were encountered: