Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1ea4229

Browse files
authored
docs(svelte): add missing documentation about using @testing-library/jest-dom with TypeScript (#1472)
1 parent d49f5a1 commit 1ea4229

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎docs/svelte-testing-library/setup.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,18 @@ runner that's ESM compatible.
138138
[resolve-conditions]:
139139
https://vitejs.dev/config/shared-options.html#resolve-conditions
140140

141+
### TypeScript
142+
143+
Include [`@testing-library/jest-dom`][@testing-library/jest-dom] to the TypeScript `types` to make the TypeScript compiler aware about the [`@testing-library/jest-dom`][@testing-library/jest-dom] matchers.
144+
145+
```json title="tsconfig.json"
146+
{
147+
"compilerOptions": {
148+
"types": ["@testing-library/jest-dom"],
149+
}
150+
}
151+
```
152+
141153
## Jest
142154

143155
[`@testing-library/svelte`][@testing-library/svelte] is ESM-only, which means

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /