Skip to content

Instantly share code, notes, and snippets.

@metric152
metric152 / http-test.spec.ts
Created December 21, 2017 21:36
Testing an Angular 5 HTTP call
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 ]
});