Skip to content

Commit

Permalink
fix(http): backwards support for destructuring SpectatorHttp
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkluijk committed Aug 26, 2019
1 parent cdd3fd7 commit d9bd304
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions projects/spectator/src/lib/spectator-http/spectator-http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export enum HttpMethod {
export class SpectatorHttp<S> extends BaseSpectator {
constructor(public dataService: S, public httpClient: HttpClient, public controller: HttpTestingController) {
super();

// small workaround to prevent issues if destructuring SpectatorHttp, which was common in Spectator 3
// remove in v5?
this.expectOne = this.expectOne.bind(this);
}

public expectOne(url: string, method: HttpMethod): TestRequest {
Expand Down

0 comments on commit d9bd304

Please sign in to comment.