Skip to content

Commit

Permalink
Updating error type in types file
Browse files Browse the repository at this point in the history
  • Loading branch information
erdimaden committed May 14, 2024
1 parent 19563da commit d52fc66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/coinbase/tests/address_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ describe("Address", () => {
expect(faucetTransaction).toBeInstanceOf(FaucetTransaction);
expect(faucetTransaction.getTransactionHash()).toBe("mocked_transaction_hash");
});
it("should request faucet funds and return a FaucetTransactionaaa", async () => {

it("should request faucet funds and throw an InternalError if the request does not return a transaction hash", async () => {
axiosMock.onPost().reply(200, {});
const address = new Address(VALID_ADDRESS_MODEL, client);
await expect(address.faucet()).rejects.toThrow("Failed to complete faucet request");
Expand Down
4 changes: 2 additions & 2 deletions src/coinbase/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type AddressAPIClient = {
* @param {string} walletId - The wallet ID.
* @param {string} addressId - The address ID.
* @returns {Promise<{ data: { transaction_hash: string } }>} - The transaction hash
* @throws {Error} If the request fails.
* @throws {AxiosError} If the request fails.
*/
requestFaucetFunds(
walletId: string,
Expand All @@ -26,7 +26,7 @@ export type UserAPIClient = {
* Retrieves the current user.
* @param {AxiosRequestConfig} [options] - Axios request options.
* @returns {AxiosPromise<UserModel>} - A promise resolving to the User model.
* @throws {Error} If the request fails.
* @throws {AxiosError} If the request fails.
*/
getCurrentUser(options?: AxiosRequestConfig): AxiosPromise<UserModel>;
};
Expand Down

0 comments on commit d52fc66

Please sign in to comment.