build: rxjs upgrade - got rid of TimeoutError deprecation warning
MODIFY
packages/messaging/src/eventbus/messaging.eventBus.reader.spec.ts
packages/messaging/src/eventbus/messaging.eventBus.reader.spec.ts
import { Event, matchEvent, combineEffects, act, EventError, contextFactory, bindEagerlyTo, lookup, useContext } from '@marblejs/core';
import { wait, NamedError } from '@marblejs/core/dist/+internal/utils';
import { eventValidator$, t } from '@marblejs/middleware-io';
-import { throwError, of, TimeoutError, firstValueFrom } from 'rxjs';
+import { throwError, of, firstValueFrom } from 'rxjs';
import { delay, map, tap, ignoreElements } from 'rxjs/operators';
-import { flow } from 'fp-ts/lib/function';
-import { pipe } from 'fp-ts/lib/pipeable';
+import { flow, pipe } from 'fp-ts/lib/function';
import { MsgEffect } from '../effects/messaging.effects.interface';
import { reply } from '../reply/reply';
import { messagingListener } from '../server/messaging.server.listener';
@@ -236,7 +235,9 @@ describe('#eventBus', () => {
const result = firstValueFrom(eventBusClientInstance.send(event));
- await expect(result).rejects.toEqual(new TimeoutError());
+ await expect(result).rejects.toEqual(expect.objectContaining({
+ name: 'TimeoutError',
+ }));
await eventBusInstance.close();
await eventBusClientInstance.close();

MODIFY
packages/messaging/src/server/specs/messaging.server.amqp.spec.ts
packages/messaging/src/server/specs/messaging.server.amqp.spec.ts
import { matchEvent, act } from '@marblejs/core';
import { createUuid } from '@marblejs/core/dist/+internal/utils';
import { eventValidator$, t } from '@marblejs/middleware-io';
-import { firstValueFrom, forkJoin, TimeoutError } from 'rxjs';
+import { firstValueFrom, forkJoin } from 'rxjs';
import { map, tap, delay, mapTo } from 'rxjs/operators';
import { flow } from 'fp-ts/lib/function';
import { TransportLayerConnection } from '../../transport/transport.interface';
@@ -90,7 +90,9 @@ describe('messagingServer::AMQP', () => {
const result = firstValueFrom(client.send({ type: 'TEST' }));
// then
- await expect(result).rejects.toEqual(new TimeoutError());
+ await expect(result).rejects.toEqual(expect.objectContaining({
+ name: 'TimeoutError',
+ }));
});
test('handles non-blocking communication and routes the event back to origin channel', async done => {

MODIFY
packages/messaging/src/server/specs/messaging.server.redis.spec.ts
packages/messaging/src/server/specs/messaging.server.redis.spec.ts
import { matchEvent, act } from '@marblejs/core';
import { createUuid } from '@marblejs/core/dist/+internal/utils';
import { eventValidator$, t } from '@marblejs/middleware-io';
-import { forkJoin, firstValueFrom, TimeoutError } from 'rxjs';
+import { forkJoin, firstValueFrom } from 'rxjs';
import { map, tap, delay, mapTo } from 'rxjs/operators';
import { flow } from 'fp-ts/lib/function';
import { TransportLayerConnection } from '../../transport/transport.interface';
@@ -94,7 +94,9 @@ describe('messagingServer::Redis', () => {
const result = firstValueFrom(client.send({ type: 'TEST' }));
// then
- await expect(result).rejects.toEqual(new TimeoutError());
+ await expect(result).rejects.toEqual(expect.objectContaining({
+ name: 'TimeoutError',
+ }));
});
test('handles non-blocking communication and routes the event back to origin channel', async done => {

MODIFY
packages/websockets/src/server/specs/websocket.server.helper.spec.ts
packages/websockets/src/server/specs/websocket.server.helper.spec.ts
-import { TimeoutError } from 'rxjs';
import { Marbles } from '@marblejs/core/dist/+internal/testing';
import { WebSocketStatus, WebSocketConnectionLiveness } from '../../websocket.interface';
import { WebSocketConnectionError } from '../../error/websocket.error.model';
@@ -86,7 +85,6 @@ describe('#handleClientBrokenConnection', () => {
// given
const scheduler = Marbles.createTestScheduler();
const client = createWebSocketClientMock();
- const timeoutError = new TimeoutError();
const isAlive = true;
// when
@@ -98,7 +96,7 @@ describe('#handleClientBrokenConnection', () => {
expectObservable(brokenConnection$).toBe(
`100ms a ${HEART_BEAT_TERMINATE_INTERVAL - 1}ms #`,
{ a: isAlive },
- timeoutError,
+ expect.objectContaining({ name: 'TimeoutError' }),
);
flush();
expect(client.terminate).toHaveBeenCalled();

build: rxjs upgrade - got rid of TimeoutError deprecation warning