misc fixes for v5 rest client. Add e2e private fetch tests for v5 rest client.
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user