Cancelling a market order should not be a test as by definition you are buying into the slippage.
Only way to make this test pass is by configuring matcher to break the market (No seller side)
it('should submit and cancel market order', async () => {
const oParams = {
orderType: 'buy' as 'buy',
matcherPublicKey: MATCHER_PUBLIC_KEY,
price: 10000000000000,
amount: 1000,
matcherFee: 8000000,
priceAsset: null,
amountAsset: assetId
}
const ord = order(oParams, MASTER_SEED)
const submitResp = await submitOrder(ord, {market: true, matcherUrl: MATCHER_URL})
expect(submitResp.status).toEqual('OrderAccepted')
const co = cancelOrder({ orderId: ord.id }, MASTER_SEED)
const cancelResp = await cancelSubmittedOrder(co, ord.assetPair.amountAsset, ord.assetPair.priceAsset, MATCHER_URL)
expect(cancelResp.status).toEqual('OrderCanceled')
}, TIMEOUT)