From 0324068c0c2d4a6a4cc3dfcc653d962aa51784af Mon Sep 17 00:00:00 2001 From: Michael Peyper Date: Mon, 1 Jul 2019 10:09:20 +1000 Subject: [PATCH] Update react-hooks-testing-library to @testing-library package (#1344) --- package-lock.json | 51 ++++++++++++++++++++++++------ package.json | 2 +- test/hooks/useDispatch.spec.js | 2 +- test/hooks/useReduxContext.spec.js | 2 +- test/hooks/useSelector.spec.js | 2 +- 5 files changed, 46 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1e9d84aad..434712d5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1838,6 +1838,17 @@ "@testing-library/dom": "^5.0.0" } }, + "@testing-library/react-hooks": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@testing-library/react-hooks/-/react-hooks-1.1.0.tgz", + "integrity": "sha512-piE/ceQoNf134FFVXBABDbttBJ8eLPD4eg7zIciVJv92RyvoIsBHCvvG8Vd4IG5pyuWYrkLsZTO8ucZBwa4twA==", + "dev": true, + "requires": { + "@babel/runtime": "^7.4.2", + "@types/react": "^16.8.22", + "@types/react-test-renderer": "^16.8.2" + } + }, "@types/babel__core": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.2.tgz", @@ -1929,6 +1940,31 @@ "integrity": "sha512-1YKeT4JitGgE4SOzyB9eMwO0nGVNkNEsm9qlIt1Lqm/tG2QEiSMTD4kS3aO6L+w5SClLVxALmIBESK6Mk5wX0A==", "dev": true }, + "@types/prop-types": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.1.tgz", + "integrity": "sha512-CFzn9idOEpHrgdw8JsoTkaDDyRWk1jrzIV8djzcgpq0y9tG4B4lFT+Nxh52DVpDXV+n4+NPNv7M1Dj5uMp6XFg==", + "dev": true + }, + "@types/react": { + "version": "16.8.22", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.8.22.tgz", + "integrity": "sha512-C3O1yVqk4sUXqWyx0wlys76eQfhrQhiDhDlHBrjER76lR2S2Agiid/KpOU9oCqj1dISStscz7xXz1Cg8+sCQeA==", + "dev": true, + "requires": { + "@types/prop-types": "*", + "csstype": "^2.2.0" + } + }, + "@types/react-test-renderer": { + "version": "16.8.2", + "resolved": "https://registry.npmjs.org/@types/react-test-renderer/-/react-test-renderer-16.8.2.tgz", + "integrity": "sha512-cm42QR9S9V3aOxLh7Fh7PUqQ8oSfSdnSni30T7TiTmlKvE6aUlo+LhQAzjnZBPriD9vYmgG8MXI8UDK4Nfb7gg==", + "dev": true, + "requires": { + "@types/react": "*" + } + }, "@types/resolve": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", @@ -2880,6 +2916,12 @@ "cssom": "0.3.x" } }, + "csstype": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.5.tgz", + "integrity": "sha512-JsTaiksRsel5n7XwqPAfB0l3TFKdpjW/kgAELf9vrb5adGA7UCPLajKK5s3nFrcFm3Rkyp/Qkgl73ENc1UY3cA==", + "dev": true + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -7121,15 +7163,6 @@ "scheduler": "^0.13.6" } }, - "react-hooks-testing-library": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/react-hooks-testing-library/-/react-hooks-testing-library-0.5.1.tgz", - "integrity": "sha512-wSwnVPceof2AOpdvZpiC3EX4gZiVVvY78foz0/44yYGXjC2AeaWvNAjyRH1UjlPqCfHTaEANvXCq+m9YCbWBfQ==", - "dev": true, - "requires": { - "@babel/runtime": "^7.4.2" - } - }, "react-is": { "version": "16.8.6", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", diff --git a/package.json b/package.json index 093918bc0..802f24c5a 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "@babel/plugin-transform-runtime": "^7.4.4", "@babel/preset-env": "^7.4.5", "@testing-library/react": "^8.0.1", + "@testing-library/react-hooks": "^1.1.0", "babel-eslint": "^10.0.1", "babel-jest": "^24.8.0", "codecov": "^3.5.0", @@ -74,7 +75,6 @@ "prettier": "^1.18.2", "react": "^16.8.6", "react-dom": "^16.8.6", - "react-hooks-testing-library": "^0.5.1", "react-test-renderer": "^16.8.6", "redux": "^4.0.1", "rimraf": "^2.6.3", diff --git a/test/hooks/useDispatch.spec.js b/test/hooks/useDispatch.spec.js index 6f43937c5..95d654d5f 100644 --- a/test/hooks/useDispatch.spec.js +++ b/test/hooks/useDispatch.spec.js @@ -1,6 +1,6 @@ import React from 'react' import { createStore } from 'redux' -import { renderHook } from 'react-hooks-testing-library' +import { renderHook } from '@testing-library/react-hooks' import { Provider as ProviderMock, useDispatch } from '../../src/index.js' const store = createStore(c => c + 1) diff --git a/test/hooks/useReduxContext.spec.js b/test/hooks/useReduxContext.spec.js index 6945c80dd..18b31fb0d 100644 --- a/test/hooks/useReduxContext.spec.js +++ b/test/hooks/useReduxContext.spec.js @@ -1,4 +1,4 @@ -import { renderHook } from 'react-hooks-testing-library' +import { renderHook } from '@testing-library/react-hooks' import { useReduxContext } from '../../src/hooks/useReduxContext' describe('React', () => { diff --git a/test/hooks/useSelector.spec.js b/test/hooks/useSelector.spec.js index 119f81e54..8cdc5045c 100644 --- a/test/hooks/useSelector.spec.js +++ b/test/hooks/useSelector.spec.js @@ -2,7 +2,7 @@ import React, { useCallback, useReducer } from 'react' import { createStore } from 'redux' -import { renderHook, act } from 'react-hooks-testing-library' +import { renderHook, act } from '@testing-library/react-hooks' import * as rtl from '@testing-library/react' import { Provider as ProviderMock,