Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanmino committed Mar 11, 2024
1 parent 09df68c commit f2d67a4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/handleProviderRequest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,18 @@ describe('handleProviderRequest', () => {
});

it('should rate limit requests', async () => {
checkRateLimitMock.mockImplementationOnce(() =>
Promise.resolve({ id: 1, error: new Error('Rate Limit Exceeded') }),
);
checkRateLimitMock.mockImplementationOnce(() => Promise.resolve(true));
const response = await transport.send(
{ id: 1, method: 'eth_requestAccounts' },
{ id: 1 },
);
expect(response).toEqual({
id: 1,
error: new Error('Rate Limit Exceeded'),
error: {
code: -32005,
message: 'Rate Limit Exceeded',
name: 'Limit exceeded',
},
});
});

Expand Down

0 comments on commit f2d67a4

Please sign in to comment.