Skip to content

Commit 1bd1f42

Browse files
committed
Upgrade dependencies and improve test reporting.
1 parent 253ba7c commit 1bd1f42

12 files changed

+1091
-925
lines changed

babel.config.js

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/* eslint-disable no-console */
2-
console.log("Loaded babel.config.js")
3-
41
module.exports = {
52
presets: ["@babel/preset-react"],
63
plugins: ["@babel/plugin-proposal-object-rest-spread"],

jest.config.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
/* eslint-disable no-console */
2-
console.log("Loaded jest.config.js")
2+
for (let pkg of [
3+
"@testing-library/jest-dom",
4+
"@testing-library/react",
5+
"jest",
6+
"react",
7+
"react-dom",
8+
]) {
9+
console.log(
10+
`Using \u001b[36;1m${pkg}@${require(`./node_modules/${pkg}/package.json`).version}\u001b[0m`
11+
)
12+
}
313

414
module.exports = {
515
rootDir: "./",

jest.setup.js

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* @see https://github.com/facebook/react/pull/14853
66
*/
77

8-
console.log("Loaded jest.setup.js")
9-
108
const originalError = console.error
119

1210
beforeAll(() => {

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
"@storybook/addon-links": "^5.1.9",
4949
"@storybook/addons": "^5.1.9",
5050
"@storybook/react": "^5.1.9",
51-
"@testing-library/react": "^8.0.4",
51+
"@testing-library/jest-dom": "^4.0.0",
52+
"@testing-library/react": "^8.0.8",
5253
"babel-eslint": "^10.0.2",
5354
"babel-jest": "^24.8.0",
5455
"babel-loader": "^8.0.6",
@@ -61,7 +62,6 @@
6162
"eslint-plugin-react": "^7.14.2",
6263
"eslint-plugin-react-hooks": "^1.6.1",
6364
"jest": "^24.8.0",
64-
"jest-dom": "^3.5.0",
6565
"lerna": "^3.15.0",
6666
"now": "^15.8.7",
6767
"npm-run-all": "^4.1.5",

packages/react-async-devtools/src/index.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "jest-dom/extend-expect"
1+
import "@testing-library/jest-dom/extend-expect"
22
import React from "react"
33
import { useAsync } from "react-async"
44
import { render, cleanup, waitForElement, fireEvent } from "@testing-library/react"

packages/react-async/src/Async.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable react/prop-types */
22

3-
import "jest-dom/extend-expect"
3+
import "@testing-library/jest-dom/extend-expect"
44
import React from "react"
55
import { render, fireEvent, cleanup, waitForElement } from "@testing-library/react"
66
import Async, { createInstance, globalScope } from "./index"

packages/react-async/src/globalScope.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
/* istanbul ignore file */
2+
13
/**
24
* Universal global scope object. In the browser this is `self`, in Node.js and React Native it's `global`.
5+
* This file is excluded from coverage reporting because these globals are environment-specific so we can't test them all.
36
*/
47
const globalScope = (() => {
58
if (typeof self === "object" && self.self === self) return self

packages/react-async/src/helpers.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "jest-dom/extend-expect"
1+
import "@testing-library/jest-dom/extend-expect"
22
import React from "react"
33
import { render, fireEvent, cleanup, waitForElement } from "@testing-library/react"
44
import Async, { Initial, Pending, Fulfilled, Rejected, Settled } from "./index"

packages/react-async/src/specs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable react/prop-types */
22

3-
import "jest-dom/extend-expect"
3+
import "@testing-library/jest-dom/extend-expect"
44
import React from "react"
55
import { render, fireEvent, waitForElement } from "@testing-library/react"
66

packages/react-async/src/status.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable react/prop-types */
22

3-
import "jest-dom/extend-expect"
3+
import "@testing-library/jest-dom/extend-expect"
44

55
import { getInitialStatus, getIdleStatus, statusTypes } from "./status"
66

packages/react-async/src/useAsync.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable react/prop-types */
22

3-
import "jest-dom/extend-expect"
3+
import "@testing-library/jest-dom/extend-expect"
44
import React from "react"
55
import { render, fireEvent, cleanup, waitForElement } from "@testing-library/react"
66
import { useAsync, useFetch, globalScope } from "./index"

yarn.lock

+1,069-911
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)