src/app/tests/mocks/response.ts
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};
Properties |
|
Methods |
|
Accessors |
Public json |
json()
|
Defined in src/app/tests/mocks/response.ts:22
|
Returns :
any
|
Private _body |
_body:
|
Type : any
|
Defined in src/app/tests/mocks/response.ts:12
|
body | ||||||||
getbody()
|
||||||||
Defined in src/app/tests/mocks/response.ts:14
|
||||||||
Returns :
any
|
||||||||
setbody(value: any)
|
||||||||
Defined in src/app/tests/mocks/response.ts:18
|
||||||||
Parameters :
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;
}
}