Creating tests for CSUI React components with Jest
Heyo. I've been toying with the jest example in order to implement tests in an extension, but the lack of documentation and complexity of the example is giving me a lot of headaches getting everything working.
The example doesn't deal with any imports in the example component, neither from static files, style files, parcel bundler imports, etc... So it makes it quite hard to figure out how to make it work with components that have any of them. Jest will complain to no end about it.
Also, I'd rather deal with a different folder structure than having every test isolated in a single directory. I'd rather have each test stay with their respective tsx and scss component files, but the example configuration is quite obtuse as how it parses the test files (does it just look for the .test.ts(x) extension regardless of the location?)
0 Replies