Skip to content

Commit e913ccf

Browse files
committed
[nestjs#1384] Allow async NestModule.configure method
1 parent 7d34529 commit e913ccf

4 files changed

Lines changed: 4 additions & 7 deletions

File tree

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { MiddlewareConsumer } from '../middleware/middleware-consumer.interface';
22

33
export interface NestModule {
4-
configure(consumer: MiddlewareConsumer): Promise<MiddlewareConsumer | void>;
4+
configure(consumer: MiddlewareConsumer);
55
}

packages/core/injector/module.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
ClassProvider,
66
Controller,
77
DynamicModule,
8-
// @ts-ignore
98
ExistingProvider,
109
FactoryProvider,
1110
Injectable,
@@ -168,15 +167,13 @@ export class Module {
168167
return this.addCustomProvider(injectable, this._injectables);
169168
}
170169
const instanceWrapper = new InstanceWrapper({
171-
// @ts-ignore
172170
name: injectable.name,
173171
metatype: injectable,
174172
instance: null,
175173
isResolved: false,
176174
scope: this.getClassScope(injectable),
177175
host: this,
178176
});
179-
// @ts-ignore
180177
this._injectables.set(injectable.name, instanceWrapper);
181178

182179
if (host) {

packages/core/test/middleware/middlewares-module.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ describe('MiddlewareModule', () => {
4949
});
5050

5151
describe('loadConfiguration', () => {
52-
it('should call "configure" method if method is implemented', () => {
52+
it('should call "configure" method if method is implemented', async () => {
5353
const configureSpy = sinon.spy();
5454
const mockModule = {
5555
configure: configureSpy,
5656
};
5757

58-
middlewareModule.loadConfiguration(
58+
await middlewareModule.loadConfiguration(
5959
new MiddlewareContainer(),
6060
mockModule as any,
6161
'Test' as any,

0 commit comments

Comments
 (0)