fix(tmdb): drop TestBed from cross-portal similar spec

The services Jest target has no @angular/core/testing (same CI failure
as the cache spec earlier) — construct the service via Injector.create +
runInInjectionContext instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Fable 5 committed 2026-07-05 11:47:33 +02:00
1 parent b7e717d127
commit 19f77f8fe1
1 file changed
+8 -3
@@ -1,4 +1,4 @@
import { TestBed } from '@angular/core/testing';
import { Injector, runInInjectionContext } from '@angular/core';
import { CatalogTitleMatch } from '@iptvnator/shared/interfaces';
import { CatalogTitleMatchService } from './catalog-title-match.service';
import { CrossPortalSimilarService } from './cross-portal-similar.service';
@@ -27,8 +27,10 @@ describe('CrossPortalSimilarService', () => {
let matchTitles: jest.Mock;
let isAvailable: boolean;
// The services Jest target has no @angular/core/testing — construct
// the service in a plain injection context instead of TestBed
function createService(): CrossPortalSimilarService {
TestBed.configureTestingModule({
const injector = Injector.create({
providers: [
{
provide: CatalogTitleMatchService,
@@ -41,7 +43,10 @@ describe('CrossPortalSimilarService', () => {
},
],
});
return TestBed.inject(CrossPortalSimilarService);
return runInInjectionContext(
injector,
() => new CrossPortalSimilarService()
);
}
beforeEach(() => {