feat(v4.0.0-beta.5): BREAKING CHANGE: rename "error" event to "exception" to avoid unhandled exceptions

This commit is contained in:
tiagosiebler
2025-02-06 12:08:51 +00:00
parent a8f8d6bf15
commit 57b1a72b7f
10 changed files with 42 additions and 45 deletions

View File

@@ -9,13 +9,17 @@ describe.skip('Public V5 Websocket client', () => {
describe('Topics subscription confirmation', () => {
it('can subscribeV5 to LINEAR with valid topic', async () => {
await expect(
api.subscribeV5(`publicTrade.${linearSymbol}`, linearCategory),
).resolves.toBeUndefined();
Promise.allSettled(
api.subscribeV5(`publicTrade.${linearSymbol}`, linearCategory),
),
).resolves.toStrictEqual([]);
});
it('cannot subscribeV5 to LINEAR with valid topic', async () => {
try {
await api.subscribeV5(`publicTrade.${linearSymbol}X`, linearCategory);
await Promise.allSettled(
api.subscribeV5(`publicTrade.${linearSymbol}X`, linearCategory),
);
} catch (e) {
expect(e).toBeDefined();
expect(e).toMatch(`(publicTrade.${linearSymbol}X) failed to subscribe`);