fix tests

This commit is contained in:
Tiago Siebler
2022-11-08 15:38:12 +00:00
parent 5361bebfa4
commit c8aca710b7
2 changed files with 11 additions and 13 deletions

View File

@@ -154,9 +154,9 @@ describe('Private Futures REST API POST Endpoints', () => {
marginCoin, marginCoin,
orderType: 'market', orderType: 'market',
side: 'open_long', side: 'open_long',
size: '1', size: '0.1',
symbol, symbol,
triggerPrice: '100', triggerPrice: '1000',
triggerType: 'market_price', triggerType: 'market_price',
}) })
).toMatchObject({ ).toMatchObject({
@@ -164,6 +164,8 @@ describe('Private Futures REST API POST Endpoints', () => {
data: {}, data: {},
}); });
} catch (e) { } catch (e) {
// {"code": "40889", "data": null, "msg": "The plan order of this contract has reached the upper limit"
// if the above error is seen, you need to cancel trigger orders on the test account (in futures)
console.error('submitPlanOrder: ', e); console.error('submitPlanOrder: ', e);
expect(e).toBeNull(); expect(e).toBeNull();
} }

View File

@@ -34,16 +34,11 @@ describe('Private Spot REST API POST Endpoints', () => {
toType: 'mix_usdt', toType: 'mix_usdt',
}) })
).toStrictEqual(''); ).toStrictEqual('');
// .toMatchObject({
// // not sure what this error means, probably no balance
// code: '42013',
// });
} catch (e) { } catch (e) {
// console.error('transfer: ', e); // console.error('transfer: ', e);
expect(e.body).toMatchObject({ expect(e.body).toMatchObject({
// not sure what this error means, probably no balance // not sure what this error means, probably no balance. Seems to change?
code: '42013', code: expect.stringMatching(/42013|43117/gim),
}); });
} }
}); });
@@ -115,12 +110,13 @@ describe('Private Spot REST API POST Endpoints', () => {
]) ])
).toMatchObject({ ).toMatchObject({
...sucessEmptyResponseObject(), ...sucessEmptyResponseObject(),
data: expect.any(Array), data: {
resultList: expect.any(Array),
failure: [{ errorCode: API_ERROR_CODE.QTY_LESS_THAN_MINIMUM }],
},
}); });
} catch (e) { } catch (e) {
expect(e.body).toMatchObject({ expect(e).toBeNull();
code: API_ERROR_CODE.QTY_LESS_THAN_MINIMUM,
});
} }
}); });