From 12ef980c004a263e5616143e2f76204b7e1b5e8c Mon Sep 17 00:00:00 2001 From: Balavishnu V J Date: Wed, 7 Oct 2020 22:57:27 +0530 Subject: [PATCH] BREAKING CHANGE: The exports from @testing-library/react has been removed. This library uses @testing-library/dom and exports from it. --- .travis.yml | 2 +- package.json | 4 +--- src/__tests__/index.js | 5 +++-- src/index.js | 2 +- src/simple-queries.js | 3 ++- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 72b135a..145bbdc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ node_js: - 14 - node before_install: - - npm install @testing-library/react react react-dom + - npm install @testing-library/dom install: npm install script: - npm run validate diff --git a/package.json b/package.json index f190476..c3b76be 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,6 @@ "dist" ], "peerDependencies": { - "@testing-library/react": "^11.0.4", - "react": "^16.13.1", - "react-dom": "^16.13.1" + "@testing-library/dom": "^7.24.5" } } diff --git a/src/__tests__/index.js b/src/__tests__/index.js index 07ca195..5a14b8b 100644 --- a/src/__tests__/index.js +++ b/src/__tests__/index.js @@ -1,8 +1,9 @@ -import * as rtlUtils from '@testing-library/react' +// eslint-disable-next-line testing-library/no-dom-import +import * as rtlUtils from '@testing-library/dom' import {screen} from '../' import {variants} from '../simple-queries' -jest.mock('@testing-library/react') +jest.mock('@testing-library/dom') describe('Cases of screen', () => { afterEach(() => { jest.resetAllMocks() diff --git a/src/index.js b/src/index.js index 550e81d..35aac73 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ import {getSimpleQueries, screen} from './simple-queries' -export * from '@testing-library/react' +export * from '@testing-library/dom' export {getSimpleQueries, screen} diff --git a/src/simple-queries.js b/src/simple-queries.js index d005572..5edb7cc 100644 --- a/src/simple-queries.js +++ b/src/simple-queries.js @@ -1,4 +1,5 @@ -import {screen as rtlScreen} from '@testing-library/react' +// eslint-disable-next-line testing-library/no-dom-import +import {screen as rtlScreen} from '@testing-library/dom' export const variants = [ 'LabelText',