diff --git a/src/test/MainnetService.test.ts b/src/test/MainnetService.test.ts index 10017ef..3b41865 100644 --- a/src/test/MainnetService.test.ts +++ b/src/test/MainnetService.test.ts @@ -137,13 +137,14 @@ describe("koiosTransactionsService", () => { console.log(result) expect(result).not.toBe(null) }); - test("submitTransaction", async () => { - const uint8 = new Uint8Array([0]) - let result - result = await koiosTransactionsService.submitTransaction(uint8) - expect(result).toBeInstanceOf(KoiosHttpError) - expect(result).not.toBe(null) - expect(result.statusCode).toBe(400) + test("submitTransactionBadRequest", async () => { + try { + await koiosTransactionsService.submitTransaction(new Uint8Array([0])) + } catch (e) { + expect(e).toBeInstanceOf(KoiosHttpError) + expect(e).not.toBe(null) + expect(e.statusCode).toBe(400) + } }); test("getTransactionStatus", async () => { const txHashes = [ @@ -243,7 +244,7 @@ describe("koiosAssetService", () => { console.log(result) expect(result).not.toBe(null) }); - test("getPolicyAssetAddressList", async () => { + test("mainnetGetPolicyAssetAddressList", async () => { const result = await koiosAssetService.getPolicyAssetAddressList("750900e4999ebe0d58f19b634768ba25e525aaf12403bfe8fe130501") console.log(result) expect(result).not.toBe(null) @@ -334,7 +335,7 @@ describe("koiosPoolService", () => { }); describe("koiosScriptService", () => { - test("getNativeScriptList", async () => { + test("mainnetGetNativeScriptList", async () => { const result = await koiosScriptService.getNativeScriptList() console.log(result) expect(result).not.toBe(null) diff --git a/src/test/PreprodService.test.ts b/src/test/PreprodService.test.ts index 6f7ea00..0a2a9ab 100644 --- a/src/test/PreprodService.test.ts +++ b/src/test/PreprodService.test.ts @@ -1,4 +1,4 @@ -import {BackendFactory} from "../index"; +import {BackendFactory, KoiosHttpError} from "../index"; import {describe, expect, test} from "vitest"; const koiosPreprodService = BackendFactory.getKoiosPreprodService() @@ -122,12 +122,14 @@ describe("koiosTransactionsService", () => { console.log(result) expect(result).not.toBe(null) }); - test("submitTransaction", async () => { - const uint8 = new Uint8Array([0]) - const result = await koiosTransactionsService.submitTransaction(uint8) - console.log(result) - expect(result).not.toBe(null) - expect(result.statusCode).toBe(400) + test("submitTransactionBadRequest", async () => { + try { + await koiosTransactionsService.submitTransaction(new Uint8Array([0])) + } catch (e) { + expect(e).toBeInstanceOf(KoiosHttpError) + expect(e).not.toBe(null) + expect(e.statusCode).toBe(400) + } }); test("getTransactionStatus", async () => { const txHashes = [ diff --git a/src/test/PreviewService.test.ts b/src/test/PreviewService.test.ts index 4078adb..2ce2445 100644 --- a/src/test/PreviewService.test.ts +++ b/src/test/PreviewService.test.ts @@ -9,7 +9,7 @@ import { LogicalOperatorFilter, LogicalOperatorFilterType, NotOperatorFilter, - SortType, + SortType, KoiosHttpError, } from "../index"; import {describe, expect, test} from "vitest"; @@ -142,12 +142,14 @@ describe("koiosTransactionsService", () => { console.log(result) expect(result).not.toBe(null) }); - test("submitTransaction", async () => { - const uint8 = new Uint8Array([0]) - const result = await koiosTransactionsService.submitTransaction(uint8) - console.log(result) - expect(result).not.toBe(null) - expect(result.statusCode).toBe(400) + test("submitTransactionBadRequest", async () => { + try { + await koiosTransactionsService.submitTransaction(new Uint8Array([0])) + } catch (e) { + expect(e).toBeInstanceOf(KoiosHttpError) + expect(e).not.toBe(null) + expect(e.statusCode).toBe(400) + } }); test("getTransactionStatus", async () => { const txHashes = [