Skip to content

Commit 7f99fb8

Browse files
gnapseKent C. Dodds
authored and
Kent C. Dodds
committed
fix: remove extend-expect (testing-library#70)
* Use extend-expect directly from jest-dom * Move jest-dom to devDependencies BREAKING CHANGE: dom-testing-library no longer exposes the extend-expect module. Replace anywhere you're using `'dom-testing-library/extend-expect'` with `'jest-dom/extend-expect'` 👍
1 parent ec672a6 commit 7f99fb8

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ import {
129129
wait,
130130
} from 'dom-testing-library'
131131
// adds special assertions like toHaveTextContent and toBeInTheDOM
132-
import 'dom-testing-library/extend-expect'
132+
import 'jest-dom/extend-expect'
133133

134134
function getExampleDOM() {
135135
// This is just a raw example of setting up some DOM
@@ -534,13 +534,13 @@ finding elements in the DOM similarly to how users would do.
534534

535535
## Custom Jest Matchers
536536

537-
When using [jest][], we recommend that you import a set of custom matchers that
538-
make it easier to check several aspects of the state of a DOM element. These are
539-
provided by [jest-dom](https://github.com/gnapse/jest-dom), but are also
540-
included for convenience to be imported from this library directly:
537+
When using [jest][], it is convenient to import a set of custom matchers that
538+
make it easier to check several aspects of the state of a DOM element. For
539+
exmaple, you can use the ones provided by
540+
[jest-dom](https://github.com/gnapse/jest-dom):
541541

542542
```javascript
543-
import 'dom-testing-library/extend-expect'
543+
import 'jest-dom/extend-expect'
544544
545545
// <span data-testid="greetings">Hello World</span>
546546
expect(queryByTestId(container, 'greetings')).toBeInTheDOM()

extend-expect.js

-2
This file was deleted.

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,16 @@
3535
},
3636
"files": [
3737
"dist",
38-
"typings",
39-
"extend-expect.js"
38+
"typings"
4039
],
4140
"dependencies": {
42-
"jest-dom": "^1.0.0",
4341
"pretty-format": "^22.4.3",
4442
"mutationobserver-shim": "^0.3.2",
4543
"wait-for-expect": "^0.4.0"
4644
},
4745
"devDependencies": {
4846
"dtslint": "^0.3.0",
47+
"jest-dom": "^1.7.0",
4948
"jest-in-case": "^1.0.2",
5049
"kcd-scripts": "^0.37.0",
5150
"microbundle": "^0.4.4"

0 commit comments

Comments
 (0)