File

src/app/tests/mocks/response.ts

Description

Mock for Response Object.

Provide mocked response to allow extract methods in services to retrieve a json object: const response = new MockResponse(); response.body = {some json};

Example

Index

Properties
Methods
Accessors

Methods

Public json
json()
Returns : any

Properties

Private _body
_body: any
Type : any

Accessors

body
getbody()
Returns : any
setbody(value: any)
Parameters :
Name Type Optional Description
value any
Returns : void
export class MockResponse {

  private _body: any;

  get body(): any {
    return this._body;
  }

  set body(value: any) {
    this._body = value;
  }

  public json(): any {
    return this.body;
  }

}

results matching ""

    No results matching ""