Skip to content

Commit adf3d83

Browse files
ZakTaxKent C. Dodds
authored andcommitted
docs: add simple usage instructions (#4)
* simple usage instructions * Update README.md
1 parent e386c14 commit adf3d83

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828

2929
## The problem
3030

31-
// TODO
31+
You want to use [`dom-testing-library`][dom-testing-library] methods in your Cypress tests.
3232

3333
## This solution
3434

35-
// TODO
35+
This allows you to use all the useful [`dom-testing-library`][dom-testing-library] methods in your tests.
3636

3737
## Table of Contents
3838

@@ -60,11 +60,15 @@ npm install --save-dev cypress-testing-library
6060

6161
## Usage
6262

63-
// TODO
63+
`cypress-testing-library` extends Cypress' `cy` command.
6464

65-
## Inspiration
65+
Add this line to your project's `cypress/support/commands.js`:
6666

67-
// TODO
67+
```
68+
import 'cypress-testing-library/add-commands';
69+
```
70+
71+
You can now use all of `dom-testing-library`'s `getBy` and `getAllBy` commands. [See `dom-testing-library` repo for reference](https://github.com/kentcdodds/dom-testing-library#usage)
6872

6973
## Other Solutions
7074

@@ -115,3 +119,4 @@ MIT
115119
[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/kentcdodds/cypress-testing-library.svg?style=social
116120
[emojis]: https://github.com/kentcdodds/all-contributors#emoji-key
117121
[all-contributors]: https://github.com/kentcdodds/all-contributors
122+
[dom-testing-library]: https://github.com/kentcdodds/dom-testing-library

0 commit comments

Comments
 (0)