fix: fix interceptors

This commit is contained in:
2025-02-03 23:53:49 +08:00
parent eacbbb2815
commit 26a06fdbf0
7 changed files with 291 additions and 68 deletions

View File

@@ -1,8 +1,10 @@
import { TestBed } from '@/testing';
import { provideHttpClientTesting } from '@/testing/http';
import {
HTTP_CLIENT_TEST_CONTROLLER,
provideHttpClientTesting,
} from '@/testing/http';
import { HttpHeaders } from '@ngify/http';
import { HttpTestingController } from '@ngify/http/testing';
import { provideHttpClient, withInterceptorsFromDi } from 'oidc-client-rx';
import type { HttpTestingController } from '@ngify/http/testing';
import { firstValueFrom } from 'rxjs';
import { DataService } from './data.service';
import { HttpBaseService } from './http-base.service';
@@ -14,15 +16,10 @@ describe('Data Service', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [],
providers: [
DataService,
HttpBaseService,
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
providers: [DataService, HttpBaseService, provideHttpClientTesting()],
});
dataService = TestBed.inject(DataService);
httpMock = TestBed.inject(HttpTestingController);
httpMock = TestBed.inject(HTTP_CLIENT_TEST_CONTROLLER);
});
it('should create', () => {