Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(() => {
directorRepository = mock(DirectorRepository);
serviceUnderTest = new DirectorService(
instance(directorRepository),
);
}); { provide: TranslateService, useFactory: () => instance(translateServiceMock) },
{ provide: Location, useFactory: () => instance(locationMock) }, { provide: NoticeService, useFactory: () => instance(this.mockedNoticeService) },
DatePipebeforeEach(() => {
httpClient = mock(HttpClient);
customErrorHandler = mock(CustomErrorHandler);
cacheCustomService = mock(CacheCustomService);
const configSettings = {
exlcudePath: ['categories12'],
includePath: ['categories/computers12'],
mockAllRequest: true
};
when(cacheCustomService.cacheKeyExists(anything())).thenReturn(true);
when(cacheCustomService.getCachedData(anything())).thenReturn(configSettings);
mockApiService = new MockApiService(instance(httpClient), instance(customErrorHandler), instance(cacheCustomService));
}); { provide: CategoriesService, useFactory: () => instance(categoriesServiceMock) },
{ provide: LocalizeRouterService, useFactory: () => instance(localizeServiceMock) } { provide: Location, useFactory: () => instance(locationMock) },
{ provide: ALWAYS_SET_PREFIX, useValue: true }, { provide: HttpClient, useFactory: () => instance(httpClient) },
{ provide: REST_ENDPOINT, useValue: `${BASE_URL}/site` }, { provide: Store, useFactory: () => instance(storeMock$) },
ApiServiceErrorHandler,