Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Unit Testing #232

Open
kvmw opened this issue Apr 12, 2021 · 2 comments
Open

Unit Testing #232

kvmw opened this issue Apr 12, 2021 · 2 comments

Comments

@kvmw
Copy link

kvmw commented Apr 12, 2021

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.

@mcmxcdev
Copy link

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.

@gitbreaker222
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants