Comparing version 13.5.1 to 13.5.2
@@ -21,2 +21,3 @@ import { | ||
NG_MOCKS_INTERCEPTORS, | ||
ngMocks, | ||
} from 'ng-mocks'; | ||
@@ -96,9 +97,9 @@ | ||
it('triggers interceptor', () => { | ||
const fixture = MockRender(''); | ||
const client: HttpClient = | ||
fixture.debugElement.injector.get(HttpClient); | ||
const httpMock: HttpTestingController = | ||
fixture.debugElement.injector.get(HttpTestingController); | ||
MockRender(); | ||
// Let's do a simply request. | ||
// Let's extract the service and http controller for testing. | ||
const client = ngMocks.findInstance(HttpClient); | ||
const httpMock = ngMocks.findInstance(HttpTestingController); | ||
// Let's do a simple request. | ||
client.get('/target').subscribe(); | ||
@@ -105,0 +106,0 @@ |
@@ -9,3 +9,3 @@ import { HttpClient, HttpClientModule } from '@angular/common/http'; | ||
import { MockBuilder, MockRender } from 'ng-mocks'; | ||
import { MockBuilder, MockRender, ngMocks } from 'ng-mocks'; | ||
@@ -43,8 +43,7 @@ // A service that does http requests. | ||
it('sends a request', () => { | ||
const fixture = MockRender(''); | ||
MockRender(); | ||
// Let's extract the service and http controller for testing. | ||
const service: TargetService = | ||
fixture.debugElement.injector.get(TargetService); | ||
const httpMock: HttpTestingController = | ||
fixture.debugElement.injector.get(HttpTestingController); | ||
const service = ngMocks.findInstance(TargetService); | ||
const httpMock = ngMocks.findInstance(HttpTestingController); | ||
@@ -51,0 +50,0 @@ // A simple subscription to check what the service returns. |
@@ -103,3 +103,3 @@ import { TestBed } from '@angular/core/testing'; | ||
// By default nothing should be initialized. | ||
// By default, nothing should be initialized. | ||
expect(service.onChanges).toHaveBeenCalledTimes(0); | ||
@@ -106,0 +106,0 @@ |
{ | ||
"name": "ng-mocks", | ||
"version": "13.5.1", | ||
"version": "13.5.2", | ||
"description": "An Angular testing library for creating mock services, components, directives, pipes and modules in unit tests, which includes shallow rendering, precise stubs to dump child dependencies, supports Angular 5 6 7 8 9 10 11 12 13, jasmine and jest.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
1008949
8130