---
title: "Discussion on \"Svelte Component Test Recipes\" | Hashnode"
description: "Discussion on \"Svelte Component Test Recipes\". Svelte component test recipes using Vitest & Testing Library with TypeScript"
url: "https://hashnode.com/posts/svelte-component-test-recipes/63285ed6195e7dc741da5670"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Svelte Component Test Recipes](https://davipon.hashnode.dev/svelte-component-test-recipes?utm_source=hashnode&utm_medium=feed)

Svelte component test recipes using Vitest & Testing Library with TypeScript

Sep 19, 2022 · 14 min read · davipon.hashnode.dev  
Updated Sep 21, 2022  
Read the article

-   [#svelte](https://hashnode.com/tag/svelte)
-   [#testing-library](https://hashnode.com/tag/testing-library)
-   [#component-test](https://hashnode.com/tag/component-test)
-   [#vitest](https://hashnode.com/tag/vitest)
-   [#msw](https://hashnode.com/tag/msw)

## Written by

[David Peng](https://hashnode.com/@davipon)

@davipon · Taipei, Taiwan

  
[View profile](https://hashnode.com/@davipon)

Engineering Lead @dipp

Love Web Technologies, Product Management, and Data Visualization. Building products that enable people to be more creative &amp; productive.

## Responses 2

Markdown supported · ⌘↵ to post

[Eugene Tham](https://hashnode.com/@Eugbyte)

[Jul 15, 2023](https://hashnode.com/posts/svelte-component-test-recipes/63285ed6195e7dc741da5670/comment/64b248b20470cd817f0dd8ca)

Well written article! Considering how new Svelte is, I had trouble finding tutorials online

[Brandon Paul](https://hashnode.com/@BranDonJitsu)

[Oct 14, 2022](https://hashnode.com/posts/svelte-component-test-recipes/63285ed6195e7dc741da5670/comment/6348bcbb1b098b3c50f27523)

Amazing resource David. Congragulations and thank you.

Question: is it possible to locate your tests in a different directory, but which mirrors you actual src directory? In your source code they are all co-located, but I would ideally like to have these tests in a completely different folder.

Thanks
