Skip to content

Commit 2b23c2e

Browse files
committed
test: add all cases that the lib should act in
1 parent bffa2c5 commit 2b23c2e

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

examples/simple-http-app/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
"@nestjs/common": "^10.3.7",
1717
"@nestjs/core": "^10.3.7",
1818
"@nestjs/platform-express": "^10.3.7",
19+
"@nestjs/platform-fastify": "^10.3.7",
1920
"reflect-metadata": "^0.2.2"
2021
},
2122
"devDependencies": {
2223
"@nestjs/cli": "^10.3.2",
2324
"@nestjs/schematics": "^10.1.1",
2425
"@types/node": "^20.12.2",
25-
"typescript": "^5.4.3",
26-
"nestjs-devtools-loader": "file:../../nestjs-devtools-loader-1.1.0.tgz"
26+
"nestjs-devtools-loader": "file:../../nestjs-devtools-loader-1.1.0.tgz",
27+
"typescript": "^5.4.3"
2728
}
2829
}

examples/simple-http-app/src/main.ts

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
import { NestFactory } from '@nestjs/core';
2-
import type { NestExpressApplication } from '@nestjs/platform-express';
2+
import { FastifyAdapter } from '@nestjs/platform-fastify';
33
import { AppModule } from './app.module';
44

55
async function bootstrap() {
6-
const app = await NestFactory.create<NestExpressApplication>(AppModule);
6+
// Use case 1: default adapter, default options
7+
const app = await NestFactory.create(AppModule);
8+
9+
// Use case 2: custom adapter, default options
10+
// const app = await NestFactory.create(AppModule, new FastifyAdapter());
11+
12+
// Use case 3: default adatper, custom options
13+
// const app = await NestFactory.create(AppModule, { logger: ['debug'] });
14+
15+
// Use case 4: custom adatper, custom options
16+
// const app = await NestFactory.create(AppModule, new FastifyAdapter(), { logger: ['debug'] });
17+
718
await app.listen(process.env.PORT || 3000);
819
}
9-
bootstrap();
20+
bootstrap();

0 commit comments

Comments
 (0)