mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-11 11:06:16 -08:00
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:
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(() => {
|
||||
|
||||
Reference in new issue
Block a user