Skip to content

Commit

Permalink
chore: 🤖 move npm module to @testing-library/user-event
Browse files Browse the repository at this point in the history
BREAKING CHANGE: 🧨 To use this module you know have to instal @testing-library/user-event
  • Loading branch information
Gpx committed Jun 6, 2019
1 parent 01a7d6d commit 51b780e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ change the state of the checkbox.
With NPM:

```sh
npm install user-event --dev
npm install @testing-library/user-event --dev
```

With Yarn:

```sh
yarn add user-event --dev
yarn add @testing-library/user-event --dev
```

Now simply import it in your tests:

```js
import userEvent from "user-event";
import userEvent from "@testing-library/user-event";

// or

var userEvent = require("user-event");
var userEvent = require("@testing-library/user-event");
```

## API
Expand All @@ -71,8 +71,8 @@ effects.

```jsx
import React from "react";
import { render } from "react-testing-library";
import userEvent from "user-event";
import { render } from "@testing-library/react";
import userEvent from "@testing-library/user-event";

const { getByText, getByTestId } = test("click", () => {
render(
Expand All @@ -94,8 +94,8 @@ side effects.

```jsx
import React from "react";
import { render } from "react-testing-library";
import userEvent from "user-event";
import { render } from "@testing-library/react";
import userEvent from "@testing-library/user-event";

test("double click", () => {
const onChange = jest.fn();
Expand All @@ -115,8 +115,8 @@ Writes `text` inside an `<input>` or a `<textarea>`.

```jsx
import React from "react";
import { render } from "react-testing-library";
import userEvent from "user-event";
import { render } from "@testing-library/react";
import userEvent from "@testing-library/user-event";

const { getByText } = test("click", () => {
render(<textarea data-testid="email" />);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "user-event",
"name": "@testing-library/user-event",
"version": "0.0.0-development",
"description": "Simulate user events for react-testing-library",
"keywords": [
Expand Down

0 comments on commit 51b780e

Please sign in to comment.