Skip to content

Commit

Permalink
Fix async expect.rejects.toThrow call so that the expect call is …
Browse files Browse the repository at this point in the history
…synchronous and its argument is an async callback
  • Loading branch information
MajorLift committed Jul 16, 2024
1 parent 6a15f7d commit 504e3c4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/assets-controllers/src/NftController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1280,12 +1280,14 @@ describe('NftController', () => {
const requestId = 'approval-request-id-1';
(v4 as jest.Mock).mockImplementationOnce(() => requestId);

const result = nftController.watchNft(
ERC721_NFT,
ERC721,
'https://test-dapp.com',
);
await expect(result).rejects.toThrow(
expect(
async () =>
await nftController.watchNft(
ERC721_NFT,
ERC721,
'https://test-dapp.com',
),
).rejects.toThrow(
"Unable to verify ownership. Possibly because the standard is not supported or the user's currently selected network does not match the chain of the asset in question.",
);
});
Expand Down

0 comments on commit 504e3c4

Please sign in to comment.