diff --git a/src/index.ts b/src/index.ts index 9096aa24..226e6ad4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -841,7 +841,9 @@ export namespace BunnyCdnStream { engagementScore: number; } - export type VideoHeatmapResponse = Record; + export type VideoHeatmapResponse = { + heatmap: Record; + }; export interface ListVideosResponse { totalItems: number; diff --git a/tests/Bunny.test.ts b/tests/Bunny.test.ts index 36b6113b..65455ab4 100644 --- a/tests/Bunny.test.ts +++ b/tests/Bunny.test.ts @@ -1,5 +1,6 @@ import { createReadStream, readFileSync } from "node:fs"; import { resolve } from "node:path"; +import { setTimeout } from "node:timers/promises"; import { config } from "dotenv"; import { afterAll, beforeAll, describe, expect, test } from "vitest"; import { BunnyCdnStream, BunnyCdnStreamVideo } from "../src"; @@ -118,7 +119,13 @@ describe("BunnyCdnStream", () => { { retry: 3 }, async () => { const videos = await stream.listVideos(); - expect(videos.items).toHaveLength(1); + try { + expect(videos.items).toHaveLength(1); + } catch (e) { + await setTimeout(1000); + + throw e; + } }, ); @@ -224,6 +231,12 @@ describe("BunnyCdnStream", () => { }); }); + test("GIVEN library w/ encoded video THEN can get heatmap", async () => { + const res = await stream.getVideoHeatmap(videoGuid); + + expect(res).toEqual({ heatmap: {} }); + }); + test("GIVEN library w/ encoded video THEN can update", async () => { await stream.updateVideo(videoGuid, { title: "updated" }); const vid = await stream.getVideo(videoGuid);