UNPKG

@dasch-swiss/dsp-js

Version:

JavaScript library that handles API requests to Knora

16 lines 903 B
import { AjaxError } from "rxjs/ajax"; import { ApiResponseError } from "./api-response-error"; import { DataError } from "./data-error"; describe("Test class DataError", function () { describe("Test method constructor()", function () { var ajaxError = new AjaxError("Error", new XMLHttpRequest(), { url: 'test-url', method: 'GET', async: true, headers: {}, timeout: 0, user: undefined, password: undefined, crossDomain: false, responseType: 'json', withCredentials: false }); var dataError = new DataError("Error", ApiResponseError.fromAjaxError(ajaxError)); it("should be an instance of Error", function () { expect(dataError).toEqual(jasmine.any(Error)); }); it("should be an instance of DataError", function () { expect(dataError).toEqual(jasmine.any(DataError)); }); }); }); //# sourceMappingURL=data-error.spec.js.map