Skip to content

Instantly share code, notes, and snippets.

Avatar

ernest jones metric152

View GitHub Profile
@metric152
metric152 / http-test.spec.ts
Created Dec 21, 2017
Testing an Angular 5 HTTP call
View http-test.spec.ts
import { TestBed, async, inject } from '@angular/core/testing';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [ HttpClientModule, HttpClientTestingModule ]
});