diff --git a/libs/playback/data-access/tsconfig.spec.json b/libs/playback/data-access/tsconfig.spec.json index 7f31bb031..71dd0db03 100644 --- a/libs/playback/data-access/tsconfig.spec.json +++ b/libs/playback/data-access/tsconfig.spec.json @@ -3,12 +3,12 @@ "compilerOptions": { "emitDecoratorMetadata": false, "outDir": "../../../dist/out-tsc", - "module": "commonjs", + "module": "preserve", "target": "es2016", "types": ["jest", "node"], - "moduleResolution": "node10" + "moduleResolution": "bundler" }, - "files": ["src/test-setup.ts"], + "files": ["src/test-setup.ts", "../../../global.d.ts"], "include": [ "jest.config.ts", "src/**/*.test.ts", diff --git a/libs/playlist/m3u/feature-player/src/lib/video-player/video-player-recent-history.spec.ts b/libs/playlist/m3u/feature-player/src/lib/video-player/video-player-recent-history.spec.ts index 93643cc16..845dc0ce8 100644 --- a/libs/playlist/m3u/feature-player/src/lib/video-player/video-player-recent-history.spec.ts +++ b/libs/playlist/m3u/feature-player/src/lib/video-player/video-player-recent-history.spec.ts @@ -59,7 +59,7 @@ describe('VideoPlayerComponent — recently viewed history', () => { let component: VideoPlayerComponentInstance; let gate: PlaybackHistoryGate; const activePlaylist = signal | null>(null); - const harnessSelectSignal = storeMock.selectSignal.getMockImplementation(); + const harnessSelectSignal = storeMock.selectSignal.getMockImplementation()!; beforeAll(async () => { ({ VideoPlayerComponent } = await import('./video-player.component')); @@ -74,11 +74,11 @@ describe('VideoPlayerComponent — recently viewed history', () => { externalSession.set(null); storeMock.dispatch.mockClear(); activePlaylist.set({ _id: 'playlist-1', recentlyViewed: [] }); - storeMock.selectSignal.mockImplementation((selector: unknown) => + // The harness has no playlist meta; the history write updates it. + storeMock.selectSignal.mockImplementation(((selector: unknown) => selector === selectActivePlaylist ? activePlaylist - : harnessSelectSignal?.(selector) - ); + : harnessSelectSignal(selector)) as typeof harnessSelectSignal); playlistsServiceMock.addM3uRecentlyViewed.mockClear(); await TestBed.configureTestingModule({