Skip to content

Commit 6bd61d1

Browse files
committed
Add typescript section
1 parent 98781c5 commit 6bd61d1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/svelte-testing-library/setup.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,30 @@ with any testing framework and runner you're comfortable with.
7272
npm run test
7373
```
7474
75+
## Typescript
76+
77+
In order to support Typescript, you need to enable `preprocess`.
78+
79+
1. Update your jest configuration
80+
81+
```json
82+
{
83+
"jest": {
84+
"transform": {
85+
"^.+\\.svelte$": ["svelte-jester", { "preprocess": true }]
86+
},
87+
"moduleFileExtensions": ["js", "ts", "svelte"]
88+
}
89+
}
90+
```
91+
7592
## Babel / Preprocessors
7693

7794
If you'd like to also include [Babel](https://babeljs.io/) or any
7895
[Svelte preprocessors](https://github.com/kaisermann/svelte-preprocess) then
7996
simply follow the instructions over at
8097
[svelte-jester](https://github.com/mihar-22/svelte-jester#babel).
98+
99+
```
100+
101+
```

0 commit comments

Comments
 (0)