@@ -10,7 +10,6 @@ import {
1010 Body ,
1111 Controller ,
1212 Get ,
13- INestApplication ,
1413 Post ,
1514 UploadedFile ,
1615 UseInterceptors ,
@@ -20,10 +19,7 @@ import * as supertest from 'supertest';
2019import { TsRest } from './ts-rest.decorator' ;
2120import path = require( 'path' ) ;
2221import { FileInterceptor } from '@nestjs/platform-express' ;
23- import {
24- FastifyAdapter ,
25- NestFastifyApplication ,
26- } from '@nestjs/platform-fastify' ;
22+ import { FastifyAdapter } from '@nestjs/platform-fastify' ;
2723
2824export type Equal < a , b > = ( < T > ( ) => T extends a ? 1 : 2 ) extends <
2925 T
@@ -56,12 +52,6 @@ describe('doesUrlMatchContractPath', () => {
5652} ) ;
5753
5854describe ( 'ts-rest-nest-handler' , ( ) => {
59- let app : INestApplication ;
60-
61- afterEach ( async ( ) => {
62- await app . close ( ) ;
63- } ) ;
64-
6555 describe ( 'multi-handler api' , ( ) => {
6656 it ( 'should be able to implement a whole contract' , async ( ) => {
6757 const c = initContract ( ) ;
@@ -111,7 +101,7 @@ describe('ts-rest-nest-handler', () => {
111101 controllers : [ TestController ] ,
112102 } ) . compile ( ) ;
113103
114- app = moduleRef . createNestApplication ( ) ;
104+ const app = moduleRef . createNestApplication ( ) ;
115105 await app . init ( ) ;
116106
117107 const responseGet = await supertest ( app . getHttpServer ( ) )
@@ -164,7 +154,7 @@ describe('ts-rest-nest-handler', () => {
164154 controllers : [ SingleHandlerTestController ] ,
165155 } ) . compile ( ) ;
166156
167- app = moduleRef . createNestApplication ( ) ;
157+ const app = moduleRef . createNestApplication ( ) ;
168158 await app . init ( ) ;
169159
170160 const response = await supertest ( app . getHttpServer ( ) )
@@ -250,7 +240,7 @@ describe('ts-rest-nest-handler', () => {
250240 controllers : [ SingleHandlerTestController ] ,
251241 } ) . compile ( ) ;
252242
253- app = moduleRef . createNestApplication ( ) ;
243+ const app = moduleRef . createNestApplication ( ) ;
254244 await app . init ( ) ;
255245
256246 const response = await supertest ( app . getHttpServer ( ) ) . get ( '/test' ) . send ( ) ;
@@ -299,7 +289,7 @@ describe('ts-rest-nest-handler', () => {
299289 controllers : [ SingleHandlerTestController ] ,
300290 } ) . compile ( ) ;
301291
302- app = moduleRef . createNestApplication ( ) ;
292+ const app = moduleRef . createNestApplication ( ) ;
303293 await app . init ( ) ;
304294
305295 const response = await supertest ( app . getHttpServer ( ) )
@@ -366,7 +356,7 @@ describe('ts-rest-nest-handler', () => {
366356 controllers : [ SingleHandlerTestController ] ,
367357 } ) . compile ( ) ;
368358
369- app = moduleRef . createNestApplication ( ) ;
359+ const app = moduleRef . createNestApplication ( ) ;
370360 await app . init ( ) ;
371361
372362 const response = await supertest ( app . getHttpServer ( ) ) . get ( '/test' ) . send ( ) ;
@@ -428,7 +418,7 @@ describe('ts-rest-nest-handler', () => {
428418 controllers : [ SingleHandlerTestController ] ,
429419 } ) . compile ( ) ;
430420
431- app = moduleRef . createNestApplication ( ) ;
421+ const app = moduleRef . createNestApplication ( ) ;
432422 await app . init ( ) ;
433423
434424 const responseNested = await supertest ( app . getHttpServer ( ) )
@@ -557,7 +547,7 @@ describe('ts-rest-nest-handler', () => {
557547 controllers : [ SingleHandlerTestController ] ,
558548 } ) . compile ( ) ;
559549
560- app = moduleRef . createNestApplication ( ) ;
550+ const app = moduleRef . createNestApplication ( ) ;
561551 await app . init ( ) ;
562552
563553 const response = await supertest ( app . getHttpServer ( ) )
@@ -618,7 +608,7 @@ describe('ts-rest-nest-handler', () => {
618608 controllers : [ SingleHandlerTestController ] ,
619609 } ) . compile ( ) ;
620610
621- app = moduleRef . createNestApplication ( ) ;
611+ const app = moduleRef . createNestApplication ( ) ;
622612 await app . init ( ) ;
623613
624614 const response = await supertest ( app . getHttpServer ( ) ) . get ( '/test' ) . send ( ) ;
@@ -668,7 +658,7 @@ describe('ts-rest-nest-handler', () => {
668658 controllers : [ SingleHandlerTestController ] ,
669659 } ) . compile ( ) ;
670660
671- app = moduleRef . createNestApplication ( ) ;
661+ const app = moduleRef . createNestApplication ( ) ;
672662 await app . init ( ) ;
673663
674664 const response = await supertest ( app . getHttpServer ( ) ) . get ( '/test' ) . send ( ) ;
@@ -736,7 +726,7 @@ describe('ts-rest-nest-handler', () => {
736726 controllers : [ SingleHandlerTestController ] ,
737727 } ) . compile ( ) ;
738728
739- app = moduleRef . createNestApplication ( ) ;
729+ const app = moduleRef . createNestApplication ( ) ;
740730 await app . init ( ) ;
741731
742732 const response = await supertest ( app . getHttpServer ( ) )
@@ -848,7 +838,7 @@ describe('ts-rest-nest-handler', () => {
848838 controllers : [ MultiTypeHandlerController ] ,
849839 } ) . compile ( ) ;
850840
851- app = moduleRef . createNestApplication ( ) ;
841+ const app = moduleRef . createNestApplication ( ) ;
852842
853843 await app . init ( ) ;
854844
@@ -983,9 +973,7 @@ describe('ts-rest-nest-handler', () => {
983973 controllers : [ FastifyController ] ,
984974 } ) . compile ( ) ;
985975
986- app = moduleRef . createNestApplication < NestFastifyApplication > (
987- new FastifyAdapter ( )
988- ) ;
976+ const app = moduleRef . createNestApplication ( new FastifyAdapter ( ) ) ;
989977
990978 await app . init ( ) ;
991979 await app . getHttpAdapter ( ) . getInstance ( ) . ready ( ) ;
0 commit comments