Unit tests for user code

I have built a webapp that utilizes VTK.js. I have not been able to get unit test coverage for my classes that reference VTK.js code. Karma (which is used in VTK.js) is built for CommonJs modules. It has tools for using ES modules, but they don’t seem to work together with the VTK.js libraries and Typescript.

Have any folks found unit test tools that work for Typescript code that utilizes VTK.js?

BTW, I noticed that ParaView Glance does not include any unit tests at all. Perhaps this problem is harder to solve than I hope.

Are you transpiling your TS code and then testing? Transpiling (especially with a bundler like webpack) should remove the need for dealing with modules when testing. Though it does introduce a transpile/bundle step into your unit testing workflow.