All files / src/testing-helpers/http.test.helpers http.test.hlpr.ts

90.91% Statements 10/11
25% Branches 2/8
75% Functions 3/4
85.71% Lines 6/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181x     1x     4x     1x   1x         1x  
import { Response, ResponseOptions } from '@angular/http';
 
// Ref: https://stackoverflow.com/a/45171930/8745435
export class MockError extends Response implements Error {
  name: any;
  message: any;
  constructor(status: number, Ebody: string = '') {
      super(new ResponseOptions({status, body}));
  }
}
 
export class MockResponse extends Response {
  name: any;
  constructor(status: number, body: string = '') {
    super(new ResponseOptions({status, body}));
  }
}