Skip to content

Commit

Permalink
fix(test): fix callContract() test
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcticae committed Jun 20, 2022
1 parent 774fa56 commit b11c5da
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions __tests__/provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,19 @@ describe('defaultProvider', () => {
).resolves.not.toThrow();
});

test('callContract() - gateway error', () => {
return expect(
provider.callContract({
test('callContract() - gateway error', async () => {
try {
await provider.callContract({
contractAddress: exampleContractAddress,
entrypoint: 'non_existent_entrypoint',
calldata: compileCalldata({
user: '0xdeadbeef',
}),
})
).rejects.toThrow(
expect.objectContaining({
message:
'Entry point 0x23b0c8b3d98aa73d8a35f5303fe77d132c6d04279e63f6e1d6aac5946e04612 not found in contract with class hash 0x2864c45bd4ba3e66d8f7855adcadf07205c88f43806ffca664f1f624765207e.',
errorCode: 'StarknetErrorCode.ENTRY_POINT_NOT_FOUND_IN_CONTRACT',
})
);
});
} catch (e) {
expect(e).toHaveProperty('message');
expect(e).toHaveProperty('errorCode');
}
});

test('transaction trace', async () => {
Expand Down

0 comments on commit b11c5da

Please sign in to comment.