|
5 | 5 | } from '@nestjs/platform-fastify';
|
6 | 6 | import { AppModule } from '../src/app.module';
|
7 | 7 | import { NoopLogger } from '../utils/noop-logger';
|
| 8 | +import request from 'supertest'; |
8 | 9 |
|
9 | 10 | describe('Fastify adapter', () => {
|
10 | 11 | let app: NestFastifyApplication;
|
@@ -82,14 +83,15 @@ describe('Fastify adapter', () => {
|
82 | 83 | });
|
83 | 84 |
|
84 | 85 | describe('when trying to get a non-existing file', () => {
|
85 |
| - it('should return 404', async () => { |
| 86 | + it('should returns index page', async () => { |
86 | 87 | return app
|
87 | 88 | .inject({
|
88 | 89 | method: 'GET',
|
89 | 90 | url: '/404'
|
90 | 91 | })
|
91 | 92 | .then((result) => {
|
92 |
| - expect(result.statusCode).toEqual(404); |
| 93 | + expect(result.statusCode).toEqual(200); |
| 94 | + expect(result.payload).toContain('Static website'); |
93 | 95 | });
|
94 | 96 | });
|
95 | 97 | });
|
@@ -172,15 +174,14 @@ describe('Fastify adapter', () => {
|
172 | 174 | });
|
173 | 175 |
|
174 | 176 | describe('when trying to get a non-existing file', () => {
|
175 |
| - it('should returns index page', async () => { |
| 177 | + it('should return 404', async () => { |
176 | 178 | return app
|
177 | 179 | .inject({
|
178 | 180 | method: 'GET',
|
179 | 181 | url: '/404'
|
180 | 182 | })
|
181 | 183 | .then((result) => {
|
182 |
| - expect(result.statusCode).toEqual(200); |
183 |
| - expect(result.payload).toContain('Static website'); |
| 184 | + expect(result.statusCode).toEqual(404); |
184 | 185 | });
|
185 | 186 | });
|
186 | 187 | });
|
|
0 commit comments