Browse Source

create a mock rest service which doesn't report errors

pull/6810/head
Arman Ozak 6 years ago
parent
commit
ab0116cca7
  1. 1
      npm/ng-packs/packages/core/testing/src/lib/services/index.ts
  2. 21
      npm/ng-packs/packages/core/testing/src/lib/services/mock-rest.service.ts

1
npm/ng-packs/packages/core/testing/src/lib/services/index.ts

@ -0,0 +1 @@
export * from './mock-rest.service';

21
npm/ng-packs/packages/core/testing/src/lib/services/mock-rest.service.ts

@ -0,0 +1,21 @@
import { ABP, CORE_OPTIONS, EnvironmentService, RestService } from '@abp/ng.core';
import { HttpClient } from '@angular/common/http';
import { Inject, Injectable } from '@angular/core';
import { Observable, throwError } from 'rxjs';
@Injectable({
providedIn: 'root',
})
export class MockRestService extends RestService {
constructor(
@Inject(CORE_OPTIONS) protected options: ABP.Root,
protected http: HttpClient,
protected environment: EnvironmentService,
) {
super(options, http, environment, null);
}
handleError(err: any): Observable<any> {
return throwError(err);
}
}
Loading…
Cancel
Save