Unable to perform simple tests with CSD components? #1692
-
Hello! Have really been enjoying CSD lately. We are wanting to incorporate this in a corporate setting, and I have been been reading over the documentation for implementing unit-tests. However, I can not figure out why I am unable to run a simple test on these components. I have tried referring to the documentation and tried reproducing the guidance from #1655 -- I made a clean repo provided from Vitest which you can find here. Whenever I run the unit test, I am given the following error:
We are also seeing the same error in our larger repository, but no luck when testing on a clean environment. I am hoping the solution to this is not too obvious, but would appreciate and help/guidance! Thanks so much! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think the issue is in this line https://github.com/fltzr/vitest-cloudscape-unit-test/blob/4d50a484c4d1542e445634c72cdeb0db96975628/vite.config.ts#L14
For additional context, this is sort of a known issue: dperini/nwsapi#92 This module is used in JSDOM, which runs tests in your demo |
Beta Was this translation helpful? Give feedback.
I think the issue is in this line https://github.com/fltzr/vitest-cloudscape-unit-test/blob/4d50a484c4d1542e445634c72cdeb0db96975628/vite.config.ts#L14
css: true
option can't be used in vitest with our components. Can you try turning it off and test again?For additional context, this is sort of a known issue: dperini/nwsapi#92
This module is used in JSDOM, which runs tests in your demo