Skip to content

Commit 9e469cf

Browse files
renovate[bot]renovate-boteps1lon
authored
chore(deps): bump react to ^18.0.0 (#823)
Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: eps1lon <[email protected]>
1 parent eb41881 commit 9e469cf

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

tests/build/fixtures/ava-ts-node/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"name": "build-fixture-node-es-modules",
33
"private": true,
44
"dependencies": {
5-
"@testing-library/react": "^12.0.0",
5+
"@testing-library/react": "^13.0.0",
66
"@types/jsdom": "^16.2.1",
77
"@types/react": "^17.0.0",
88
"@types/react-dom": "^17.0.0",
99
"@types/testing-library__react": "^10.0.1",
1010
"ava": "^4.0.0",
1111
"jsdom": "^19.0.0",
12-
"react": "^17.0.0",
13-
"react-dom": "^17.0.0",
12+
"react": "^18.0.0",
13+
"react-dom": "^18.0.0",
1414
"ts-node": "^10.0.0",
1515
"typescript": "^4.0.0"
1616
},
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
import test from "ava";
22
import { JSDOM } from "jsdom";
3-
import { getByRole } from "@testing-library/react";
3+
import { findByRole } from "@testing-library/react";
44
import * as React from "react";
5-
import * as ReactDOM from "react-dom";
5+
import * as ReactDOMClient from "react-dom/client";
66

7-
test("fn() returns foo", (t) => {
7+
test("fn() returns foo", async (t) => {
88
const { window } = new JSDOM();
99
// @ts-ignore
1010
global.window = window;
1111
// @ts-ignore
1212
global.document = window.document;
1313

1414
const container = document.createElement("div");
15-
ReactDOM.render(
16-
React.createElement("div", { children: "Hello, Dave!", role: "button" }),
17-
container
15+
ReactDOMClient.createRoot(container).render(
16+
React.createElement("div", { children: "Hello, Dave!", role: "button" })
17+
);
18+
// findByRole depends on `dom-accessibility-api`
19+
await t.notThrowsAsync(() =>
20+
findByRole(container, "button", { name: "Hello, Dave!" })
1821
);
19-
// getByRole depends on `dom-accessibility-api`
20-
t.truthy(getByRole(container, "button", { name: "Hello, Dave!" }));
2122
});

0 commit comments

Comments
 (0)