From fe311aba0a3e6d40190749cffe08fc4fe59c4dd6 Mon Sep 17 00:00:00 2001 From: Sergio Cinos Date: Fri, 25 Sep 2020 06:49:21 +0200 Subject: [PATCH] Add dependency on wait-for-expect to drop @testing-library/react --- packages/data-stores/package.json | 4 +--- packages/data-stores/src/auth/test/flows.ts | 6 +++--- yarn.lock | 5 +++++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/data-stores/package.json b/packages/data-stores/package.json index 7543ee5ca8bc25..71efd91536b1b0 100644 --- a/packages/data-stores/package.json +++ b/packages/data-stores/package.json @@ -48,10 +48,8 @@ "react": "^16.12.0" }, "devDependencies": { - "@testing-library/react": "^10.0.5", "jest-fetch-mock": "^2.1.2", "nock": "^12.0.3", - "react": "^16.12.0", - "react-dom": "^16.12.0" + "wait-for-expect": "^3.0.2" } } diff --git a/packages/data-stores/src/auth/test/flows.ts b/packages/data-stores/src/auth/test/flows.ts index 2637e1710d29af..8a50b41528cf17 100644 --- a/packages/data-stores/src/auth/test/flows.ts +++ b/packages/data-stores/src/auth/test/flows.ts @@ -14,7 +14,7 @@ import { parse } from 'qs'; import wpcomRequest from 'wpcom-proxy-request'; import 'jest-fetch-mock'; import nock from 'nock'; -import { waitFor } from '@testing-library/react'; +import waitForExpect from 'wait-for-expect'; /** * Internal dependencies @@ -237,11 +237,11 @@ describe( 'password login flow', () => { // Don't await the promise, it doesn't resolve until login flow is complete submitPassword( 'passw0rd' ); - await waitFor( () => expect( getLoginFlowState() ).toBe( 'WAITING_FOR_2FA_APP' ) ); + await waitForExpect( () => expect( getLoginFlowState() ).toBe( 'WAITING_FOR_2FA_APP' ) ); userHandledPushNotification = true; - await waitFor( () => expect( getLoginFlowState() ).toBe( 'LOGGED_IN' ) ); + await waitForExpect( () => expect( getLoginFlowState() ).toBe( 'LOGGED_IN' ) ); } ); } ); diff --git a/yarn.lock b/yarn.lock index 4b360688d3f3be..81897ff484ffe7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -28585,6 +28585,11 @@ w3c-xmlserializer@^2.0.0: dependencies: xml-name-validator "^3.0.0" +wait-for-expect@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/wait-for-expect/-/wait-for-expect-3.0.2.tgz#d2f14b2f7b778c9b82144109c8fa89ceaadaa463" + integrity sha512-cfS1+DZxuav1aBYbaO/kE06EOS8yRw7qOFoD3XtjTkYvCvh3zUvNST8DXK/nPaeqIzIv3P3kL3lRJn8iwOiSag== + wait-on@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/wait-on/-/wait-on-3.3.0.tgz#9940981d047a72a9544a97b8b5fca45b2170a082"