@dasch-swiss/dsp-js
Version:
JavaScript library that handles API requests to Knora
43 lines (42 loc) • 1.3 kB
TypeScript
export declare namespace MockAjaxCall {
/**
* Mocks a successful response to an Ajax call.
*
* @param mockData mocked data to be returned in the successful response's body.
*/
const mockResponse: (mockData: string) => {
status: number;
responseText: string;
response: any;
};
/**
* Mocks a unsuccessful 401 Not Authorized response to an Ajax call.
*
* @param mockData mocked data to be returned in the successful response's body.
*/
const mockNotAuthorizedResponse: (mockData?: string) => {
status: number;
responseText: string;
response: any;
};
/**
* Mocks a unsuccessful 404 Not Found response to an Ajax call.
*
* @param mockData mocked data to be returned in the successful response's body.
*/
const mockNotFoundResponse: (mockData?: string) => {
status: number;
responseText: string;
response: any;
};
/**
* Mocks a unsuccessful 400 Bad Request response to an Ajax call.
*
* @param mockData mocked data to be returned in the successful response's body.
*/
const mockBadRequestResponse: (mockData?: string) => {
status: number;
responseText: string;
response: any;
};
}