Unit test?

Hi,
I am wondering if vtk js has unit tests integrated, and if so, how to run them all.
Thanks!

Yes, vtk.js has tests. You can run them with npm run test.

1 Like

@Forrest another question, I can generate the report through the command you provided, which is generated by karma.
I am wondering if there is a easy way to generate the XML report with coverage, like karma-coverage.
I have tried it, changed and added the necessary npm packages, but the report comes out with zero lines checked.
I am wondering if anyone has tried this before.
kind regards,
Lonewolf

Anyone? I would really appreciate input on the second question, to keep it all together here. Instead of opening another thread.

Cheers!

I haven’t tried using karma-coverage, but have you ensured you’re instrumenting all of the files? I can give it a shot some time next week.

I would appreciate that very much! Thank you!

@Forrest were you able to do it?

Turns out that we already use karma-coverage. The output gets written to Documentation/build-tmp/public/coverage/index.html.

Thanks for coming back to the topic @Forrest ,
I checked and indeed I see the file. However, when I open it, it shows Unknown % 0/0 for all entries.

What command do you exactly use?

I ran npm test, then opened the file I mentioned above. Sample screenshot provided below.

1 Like