2017-08-28 13:29:35 -04:00
|
|
|
/** @stable */
|
2017-03-22 20:13:24 -04:00
|
|
|
export declare class HttpClientTestingModule {
|
|
|
|
}
|
|
|
|
|
2017-08-28 13:29:35 -04:00
|
|
|
/** @stable */
|
2017-03-22 20:13:24 -04:00
|
|
|
export declare abstract class HttpTestingController {
|
2017-07-07 17:56:36 -04:00
|
|
|
abstract expectNone(url: string, description?: string): void;
|
|
|
|
abstract expectNone(params: RequestMatch, description?: string): void;
|
|
|
|
abstract expectNone(matchFn: ((req: HttpRequest<any>) => boolean), description?: string): void;
|
|
|
|
abstract expectNone(match: string | RequestMatch | ((req: HttpRequest<any>) => boolean), description?: string): void;
|
|
|
|
abstract expectOne(url: string, description?: string): TestRequest;
|
|
|
|
abstract expectOne(params: RequestMatch, description?: string): TestRequest;
|
|
|
|
abstract expectOne(matchFn: ((req: HttpRequest<any>) => boolean), description?: string): TestRequest;
|
|
|
|
abstract expectOne(match: string | RequestMatch | ((req: HttpRequest<any>) => boolean), description?: string): TestRequest;
|
2017-03-22 20:13:24 -04:00
|
|
|
abstract match(match: string | RequestMatch | ((req: HttpRequest<any>) => boolean)): TestRequest[];
|
|
|
|
abstract verify(opts?: {
|
|
|
|
ignoreCancelled?: boolean;
|
|
|
|
}): void;
|
|
|
|
}
|
|
|
|
|
2017-08-28 13:29:35 -04:00
|
|
|
/** @stable */
|
2017-03-22 20:13:24 -04:00
|
|
|
export interface RequestMatch {
|
|
|
|
method?: string;
|
|
|
|
url?: string;
|
|
|
|
}
|
|
|
|
|
2017-08-28 13:29:35 -04:00
|
|
|
/** @stable */
|
2017-03-22 20:13:24 -04:00
|
|
|
export declare class TestRequest {
|
|
|
|
readonly cancelled: boolean;
|
|
|
|
request: HttpRequest<any>;
|
|
|
|
constructor(request: HttpRequest<any>, observer: Observer<HttpEvent<any>>);
|
|
|
|
error(error: ErrorEvent, opts?: {
|
|
|
|
headers?: HttpHeaders | {
|
|
|
|
[name: string]: string | string[];
|
|
|
|
};
|
|
|
|
status?: number;
|
|
|
|
statusText?: string;
|
|
|
|
}): void;
|
|
|
|
event(event: HttpEvent<any>): void;
|
|
|
|
flush(body: ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[] | null, opts?: {
|
|
|
|
headers?: HttpHeaders | {
|
|
|
|
[name: string]: string | string[];
|
|
|
|
};
|
|
|
|
status?: number;
|
|
|
|
statusText?: string;
|
|
|
|
}): void;
|
|
|
|
}
|