Skip to content

Commit a204bae

Browse files
dariyegnapse
authored andcommitted
docs: Note about TypeScript and jest setup files (#129)
1 parent 567d3ad commit a204bae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ Import `@testing-library/jest-dom/extend-expect` once (for instance in your
9797
import '@testing-library/jest-dom/extend-expect'
9898
```
9999

100+
> Note: If you're using TypeScript, make sure your setup file is a `.ts` and not a `.js` to include the necessary types.
101+
100102
Alternatively, you can selectively import only the matchers you intend to use,
101103
and extend jest's `expect` yourself:
102104

@@ -106,9 +108,7 @@ import {toBeInTheDocument, toHaveClass} from '@testing-library/jest-dom'
106108
expect.extend({toBeInTheDocument, toHaveClass})
107109
```
108110

109-
> Note: when using TypeScript, this way of importing matchers won't provide the
110-
> necessary type definitions. More on this
111-
> [here](https://github.com/testing-library/jest-dom/pull/11#issuecomment-387817459).
111+
> Note: when using TypeScript, this way of importing matchers won't provide the necessary type definitions. More on this [here](https://github.com/testing-library/jest-dom/pull/11#issuecomment-387817459).
112112
113113
## Custom matchers
114114

0 commit comments

Comments
 (0)