wd-David / svelte-component-test-recipes

Svelte component test recipes using Vitest & Testing Library with TypeScript
156 stars 5 forks source link

include msw? #1

Closed ranielzed closed 2 years ago

ranielzed commented 2 years ago

Thanks for setting this up! This is very helpful and encourages testing for more reliable code. Though I'm not sure if this is in scope but it would be nice if there's also a recipe for setting up msw for components that fetch data

wd-David commented 2 years ago

@ranielzed I'm glad it's helpful!

That's a good idea and I'd love to add it. I did have an msw example in another repo svelte-add-vitest but it lacks explanation.

Kindly let me know if you have any good examples or ideas to demonstrate in this repo.

ranielzed commented 2 years ago

@davipon Thanks! Perhaps a couple of recipes for internal and external fetch calls would be great. Just to show simple examples of how msw could work with vitest, testing-library, etc could all work together

wd-David commented 2 years ago

@ranielzed I added msw examples for internal and external fetch calls.

ranielzed commented 2 years ago

@davipon Looks good! Thank you for your work.. This serves as a good starting point for testing data calls.

I'll close this issue now :)