wd-David / svelte-component-test-recipes

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

Internal / External Fetch using Axios instead of Fetch #61

Closed Skylli202 closed 1 year ago

Skylli202 commented 1 year ago

Hi,

Firstly, thanks for your awesome work @davipon.
This issue is more a question than a real repo issue. I hope you don't mind that.

I'd like to know why, in your Internal / External fetch examples, you choose to use Axios. Well-known deps for sure, but in all the Svelte documentation (Svelte & SvelteKit docs) they always show us the native fetch function.

Thanks in advance for your answer.

wd-David commented 1 year ago

Hi @Skylli202, it was a historical reason that msw didn't support native Node.js 18 fetch: https://github.com/mswjs/msw/issues/1388.

While it seems msw supports now, you could give it a try.

Skylli202 commented 1 year ago

Thanks a lot for your quick answer. This is not related, but I'd like to inform you that svelte-htm and svelte-fragment-component are not been updated (yet? idk if they are still maintained) for Svelte 4.0.

Would you accept a PR who just add a warning at the start of the README.md ?

wd-David commented 1 year ago

Yeah sure! PR is welcome.

I haven't worked on a Svelte project professionally for half a year, I believe those packages might not be an ideal solution now. Maybe there is a better way to do component test in Svelte 4 or 5.