From e943a2ffa91e62f5000d88a91ffc2f4cb6c7536b Mon Sep 17 00:00:00 2001 From: Arnaud Date: Fri, 13 Sep 2024 20:45:30 +0200 Subject: [PATCH] Re enable test in debug --- src/debug/debug.test.ts | 17 ++++++++++------- src/marketplace/marketplace.ts | 3 --- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/debug/debug.test.ts b/src/debug/debug.test.ts index 5a1b248..58d1406 100644 --- a/src/debug/debug.test.ts +++ b/src/debug/debug.test.ts @@ -30,13 +30,16 @@ describe("debug", () => { }); }); - // it("returns a success when trying to setup the log level with a correct value", async (t) => { - // const spy = vi.spyOn(Fetch, "safe"); + it("returns a success when trying to setup the log level with a correct value", async (t) => { + const mockResponse = { + ok: true, + status: 200, + text: async () => "", + } as Response; + globalThis.fetch = vi.fn().mockResolvedValue(mockResponse); - // expect(spy).toHaveBeenCalledTimes(1); + const response = await debug.setLogLevel("ERROR"); - // const response = await debug.setLogLevel("ERROR"); - - // assert.deepStrictEqual(response, { error: false, data: true }); - // }); + assert.deepStrictEqual(response, { error: false, data: "" }); + }); }); diff --git a/src/marketplace/marketplace.ts b/src/marketplace/marketplace.ts index 6c12869..8097a72 100644 --- a/src/marketplace/marketplace.ts +++ b/src/marketplace/marketplace.ts @@ -220,9 +220,6 @@ export class CodexMarketplace { const res = await Fetch.safe(url, { method: "POST", - // headers: { - // "content-type": "application/json", - // }, body: JSON.stringify({ duration: duration.toString(), reward: reward.toString(),