template
template copied to clipboard
Unit Testing
would be nice to include the testing dependencies and a simple test in the template to ease the setup of unit testing.
in general i didn't see many documents/tutorials covering unit testing subject in svelte.
I just have a single unit test in my project to verify that it works, but you can go through the jest config and package.json and see for yourself how to set it up, in case you haven't. https://github.com/mhatvan/markushatvan.com/blob/master/src/lib/InspirationalQuote.spec.ts
Adding unit testing right into the template you will probably get different opinions, but it should be at least documented on svelte.dev how to do it.
I recently wrote a testing setup and stumbled upon this: https://testing-library.com/docs/svelte-testing-library/setup/
It looks like testing-library is a universal approach for documenting a best-practice js-testing how-to-setup. If this is suitable, svelte wouldn't necessarily need to write and maintain testing stuff, but simply hint to that resource in the README instead.