misc fixes for v5 rest client. Add e2e private fetch tests for v5 rest client.

This commit is contained in:
tiagosiebler
2023-02-20 12:25:54 +00:00
parent 69502f9e57
commit fc1e3945c0
4 changed files with 279 additions and 7 deletions

View File

@@ -1,13 +1,14 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { API_ERROR_CODE } from '../src';
const SUCCESS_MSG_REGEX = /OK|SUCCESS|success|success\.|Request accepted|/gim;
export const SUCCESS_MSG_REGEX =
/OK|SUCCESS|success|success\.|Request accepted|/gim;
export function successResponseList(successMsg: string | null = 'OK') {
return {
result: expect.any(Array),
ret_code: API_ERROR_CODE.SUCCESS,
ret_msg: successMsg,
ret_code: API_ERROR_CODE.SUCCESS,
};
}
@@ -23,8 +24,8 @@ export function successResponseListV3() {
export function successResponseObject() {
return {
result: expect.any(Object),
ret_code: API_ERROR_CODE.SUCCESS,
ret_msg: expect.stringMatching(SUCCESS_MSG_REGEX),
ret_code: API_ERROR_CODE.SUCCESS,
};
}