1- import { BadRequestException , Post , Module } from '@nestjs/common' ;
1+ import { BadRequestException , Module , Post } from '@nestjs/common' ;
2+ import { MODULE_PATH } from '@nestjs/common/constants' ;
23import { expect } from 'chai' ;
34import * as sinon from 'sinon' ;
45import { Controller } from '../../../common/decorators/core/controller.decorator' ;
56import { Get } from '../../../common/decorators/http/request-mapping.decorator' ;
67import { ExpressAdapter } from '../../adapters/express-adapter' ;
78import { ApplicationConfig } from '../../application-config' ;
89import { RoutesResolver } from '../../router/routes-resolver' ;
9- import { MODULE_PATH } from '@nestjs/common/constants' ;
1010
1111describe ( 'RoutesResolver' , ( ) => {
12-
1312 @Controller ( 'global' )
1413 class TestRoute {
1514 @Get ( 'test' )
@@ -20,12 +19,12 @@ describe('RoutesResolver', () => {
2019 }
2120
2221 @Module ( {
23- controllers : [ TestRoute ]
22+ controllers : [ TestRoute ] ,
2423 } )
2524 class TestModule { }
2625
2726 @Module ( {
28- controllers : [ TestRoute ]
27+ controllers : [ TestRoute ] ,
2928 } )
3029 class TestModule2 { }
3130
@@ -129,9 +128,27 @@ describe('RoutesResolver', () => {
129128 routesResolver . resolve ( applicationRef , 'api/v1' ) ;
130129
131130 // with module path
132- expect ( spy . getCall ( 0 ) . calledWith ( sinon . match . any , sinon . match . any , 'api/v1/test' , sinon . match . any ) ) . to . be . true ;
131+ expect (
132+ spy
133+ . getCall ( 0 )
134+ . calledWith (
135+ sinon . match . any ,
136+ sinon . match . any ,
137+ 'api/v1/test' ,
138+ sinon . match . any ,
139+ ) ,
140+ ) . to . be . true ;
133141 // without module path
134- expect ( spy . getCall ( 1 ) . calledWith ( sinon . match . any , sinon . match . any , 'api/v1' , sinon . match . any ) ) . to . be . true ;
142+ expect (
143+ spy
144+ . getCall ( 1 )
145+ . calledWith (
146+ sinon . match . any ,
147+ sinon . match . any ,
148+ 'api/v1' ,
149+ sinon . match . any ,
150+ ) ,
151+ ) . to . be . true ;
135152 } ) ;
136153
137154 it ( 'should register each module with __module_path__ if present and no basePath ' , ( ) => {
@@ -152,11 +169,24 @@ describe('RoutesResolver', () => {
152169 routesResolver . resolve ( applicationRef , '' ) ;
153170
154171 // with module path
155- expect ( spy . getCall ( 0 ) . calledWith ( sinon . match . any , sinon . match . any , '/test' , sinon . match . any ) ) . to . be . true ;
172+ expect (
173+ spy
174+ . getCall ( 0 )
175+ . calledWith (
176+ sinon . match . any ,
177+ sinon . match . any ,
178+ '/test' ,
179+ sinon . match . any ,
180+ ) ,
181+ ) . to . be . true ;
156182 // without module path
157- expect ( spy . getCall ( 1 ) . calledWith ( sinon . match . any , sinon . match . any , '' , sinon . match . any ) ) . to . be . true ;
183+ expect (
184+ spy
185+ . getCall ( 1 )
186+ . calledWith ( sinon . match . any , sinon . match . any , '' , sinon . match . any ) ,
187+ ) . to . be . true ;
158188 } ) ;
159- } )
189+ } ) ;
160190 } ) ;
161191
162192 describe ( 'mapExternalExceptions' , ( ) => {
0 commit comments