How to use the ts-mockito/lib/ts-mockito.instance function in ts-mockito

To help you get started, we’ve selected a few ts-mockito examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ivarvh / movielistr-backend-ts-ioc / test / services / DirectorService.spec.ts View on Github external
beforeEach(() => {
        directorRepository = mock(DirectorRepository);
        serviceUnderTest = new DirectorService(
            instance(directorRepository),
        );
    });
github intershop / intershop-pwa / src / app / services / routes-parser-locale-currency / localize-router.parser.spec.ts View on Github external
        { provide: TranslateService, useFactory: () => instance(translateServiceMock) },
        { provide: Location, useFactory: () => instance(locationMock) },
github intershop / intershop-pwa / src / app / services / mock-api-service.spec.ts View on Github external
beforeEach(() => {
        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));
    });
github intershop / intershop-pwa / src / app / components / category-navigation / subcategory-navigation / subcategory-navigation.component.spec.ts View on Github external
        { provide: CategoriesService, useFactory: () => instance(categoriesServiceMock) },
        { provide: LocalizeRouterService, useFactory: () => instance(localizeServiceMock) }
github intershop / intershop-pwa / src / app / services / routes-parser-locale-currency / localize-router.parser.spec.ts View on Github external
        { provide: Location, useFactory: () => instance(locationMock) },
        { provide: ALWAYS_SET_PREFIX, useValue: true },
github intershop / intershop-pwa / src / app / core / services / api.service.translate.spec.ts View on Github external
        { provide: HttpClient, useFactory: () => instance(httpClient) },
        { provide: REST_ENDPOINT, useValue: `${BASE_URL}/site` },
github intershop / intershop-pwa / src / app / core / services / api.service.translate.spec.ts View on Github external
        { provide: Store, useFactory: () => instance(storeMock$) },
        ApiServiceErrorHandler,