It's tough for GUI thing. And having the TypeScript type-checker certainly helps. But it's about time to sort out what can be unit tested, and how to do it.
Most testable:
Conversion to & from the SVG schema
Circuit inference/ extraction from schematics
(That's it?)
Maybe this works best if those portions are arranged as a separate NPM package/ TypeScript subproject.
Least testable:
Drawing graphics to the screen
UI events: mouse, keyboard, scroll, etc
"Platform interactions": opening file dialogs etc
Anything happening in the "main" processes of Electron or VsCode
All of those are doable, and in fact regularly done by plenty of GUI projects. But much harder.
As for "how to do it": unlike in, say, Python, there's a lotta testing libraries out there. Jest https://jestjs.io/docs/getting-started still seems to be the most popular, and "most popular" is a very important criteria here for its alignment with "most community support".
It's tough for GUI thing. And having the TypeScript type-checker certainly helps. But it's about time to sort out what can be unit tested, and how to do it.
Most testable:
Maybe this works best if those portions are arranged as a separate NPM package/ TypeScript subproject.
Least testable:
All of those are doable, and in fact regularly done by plenty of GUI projects. But much harder.
As for "how to do it": unlike in, say, Python, there's a lotta testing libraries out there. Jest https://jestjs.io/docs/getting-started still seems to be the most popular, and "most popular" is a very important criteria here for its alignment with "most community support".