From 7068da5fc283fa892265d19ee5a8c71890cff93e Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Tue, 2 Sep 2025 12:24:33 +0000 Subject: [PATCH] test(ytm): Fix failing type assertion --- src/backend/tests/ytm/ytm.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backend/tests/ytm/ytm.test.ts b/src/backend/tests/ytm/ytm.test.ts index 7d8d5d25..9830136d 100644 --- a/src/backend/tests/ytm/ytm.test.ts +++ b/src/backend/tests/ytm/ytm.test.ts @@ -4,12 +4,13 @@ import chai, { assert, expect } from 'chai'; import asPromised from 'chai-as-promised'; import clone from "clone"; import YTMusicSource, { ytiHistoryResponseFromShelfToPlays, ytiHistoryResponseToListItems } from "../../sources/YTMusicSource.js"; -import ytHistoryRes from './ytres.json' assert {type: 'json'}; +import ytHistoryRes from './ytres.json' with {type: 'json'}; import EventEmitter from "events"; import { generatePlay, generatePlays, normalizePlays } from '../utils/PlayTestUtils.js'; import { YTMusicSourceConfig } from '../../common/infrastructure/config/source/ytmusic.js'; import { sleep } from '../../utils.js'; import dayjs from 'dayjs'; +import { ApiResponse } from 'youtubei.js'; chai.use(asPromised); @@ -33,12 +34,12 @@ const createYtSource = (opts?: { describe('Parses History', function () { it(`Parses a history response to tracks`, async function () { - const items = ytiHistoryResponseToListItems(ytHistoryRes); + const items = ytiHistoryResponseToListItems(ytHistoryRes as ApiResponse); expect(items).length(10); }); it(`Parses a history response plays with shelf name`, async function () { - const items = ytiHistoryResponseFromShelfToPlays(ytHistoryRes); + const items = ytiHistoryResponseFromShelfToPlays(ytHistoryRes as ApiResponse); expect(items[0]?.meta?.comment).to.eq('March 2023'); }); }); -- 2.51.2