Hey @Exadra37 , looks like I was responding to you just as you wrote your follow-up. Overall, I think you landed in a good place for unit testing your JS.
I would make a few tweaks, but feel free to ignore them if you’re happily on your way:
- If the JS source code you’ve written for your
canvasabstraction is completely authored by your team, I would move the code out ofassets/vendor/, as that directory is traditionally used for third-party code. You can instead house your js inassets/jsas direct descendant files (or in a subdirectory if you have many modules that you want to semantically group) - You can simplify your
tsconfig ←→ vitest.configby creating your test files as direct siblings of the modules they test. Then your test files can import the modules under test using very simple relative paths, i.e.import { funcToTest } from "./canvas". That will allow you to remove the various aliasing configs you’ve set up, which, I can tell you from experience, can lead to configuration maintenance headaches over time. If you want to go that route, I’d use file infixing for the test files, where your test files would look likecanvas.test.ts
Either way, happy you landed in a decent spot. Test on! ![]()


















