mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
chore: minor tweaks
This commit is contained in:
@@ -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';
|
||||
|
||||
|
||||
@@ -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++;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user