chore: minor tweaks

This commit is contained in:
Kamil Myśliwiec
2023-06-29 10:27:24 +02:00
parent 2ee7a04e04
commit 7e4b0eded8
3 changed files with 6 additions and 5 deletions

View File

@@ -6,7 +6,7 @@ import {
} from '@nestjs/common/interfaces';
import { isEmpty } from '@nestjs/common/utils/shared.utils';
import { AsyncResource } from 'async_hooks';
import { defer, from as fromPromise, Observable } from 'rxjs';
import { Observable, defer, from as fromPromise } from 'rxjs';
import { mergeAll, switchMap } from 'rxjs/operators';
import { ExecutionContextHost } from '../helpers/execution-context-host';

View File

@@ -85,8 +85,8 @@ describe('InterceptorsConsumer', () => {
});
});
describe('AsyncLocalStorage', () => {
it('Allows an interceptor to set values in AsyncLocalStorage that are accesible from the controller', async () => {
describe('when AsyncLocalStorage is used', () => {
it('should allow an interceptor to set values in AsyncLocalStorage that are accesible from the controller', async () => {
const storage = new AsyncLocalStorage<Record<string, any>>();
class StorageInterceptor implements NestInterceptor {
intercept(
@@ -111,8 +111,8 @@ describe('InterceptorsConsumer', () => {
});
});
describe('Retries', () => {
it('works with RxJS retries', async () => {
describe('when retrying is enabled', () => {
it('should retry a specified amount of times', async () => {
let count = 0;
const next = () => {
count++;

View File

@@ -67,6 +67,7 @@ export class ServerMqtt extends Server implements CustomTransportStrategy {
public bindEvents(mqttClient: MqttClient) {
mqttClient.on(MESSAGE_EVENT, this.getMessageHandler(mqttClient).bind(this));
const registeredPatterns = [...this.messageHandlers.keys()];
registeredPatterns.forEach(pattern => {
const { isEventHandler } = this.messageHandlers.get(pattern);