Skip to content

Commit

Permalink
Adds missing dependencies to data-stores (#45911)
Browse files Browse the repository at this point in the history
* Adds missing dependencies to data-stores

* Add dependency on wait-for-expect to drop @testing-library/react

* Use the correctd version for peerDependency
  • Loading branch information
scinos authored Sep 28, 2020
1 parent 2d70d69 commit 5f2ba54
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
8 changes: 7 additions & 1 deletion packages/data-stores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
"wpcom-proxy-request": "^6.0.0"
},
"peerDependencies": {
"@wordpress/data": "^4"
"@wordpress/data": "^4",
"react": "^16.8"
},
"devDependencies": {
"jest-fetch-mock": "^2.1.2",
"nock": "^12.0.3",
"wait-for-expect": "^3.0.2"
}
}
6 changes: 3 additions & 3 deletions packages/data-stores/src/auth/test/flows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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' ) );
} );
} );

Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5f2ba54

Please sign in to comment.