-
I have created a new deepkit app and have edited test('http controller', async () => {
const testing = createTestingApp({
controllers: [HelloWorldControllerHttp],
providers: [Service]
});
console.time()
await testing.startServer();
console.timeEnd()
try {
const response = await testing.request(HttpRequest.GET('/hello/World'));
expect(response.statusCode).toBe(200);
expect(response.json).toBe("Hello World!");
} finally {
await testing.stopServer();
}
}); It show me: If I do the same using NestJs (creates new app and measure the time): describe('AppController (e2e)', () => {
let app: INestApplication;
beforeEach(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();
app = moduleFixture.createNestApplication();
console.time();
await app.init();
console.timeEnd();
});
it('/ (GET)', () => {
return request(app.getHttpServer())
.get('/')
.expect(200)
.expect('Hello World!');
});
}); It shows me Why is so slow deepkit? |
Beta Was this translation helpful? Give feedback.
Answered by
marcj
Mar 10, 2023
Replies: 1 comment 2 replies
-
Is it every time or only the very first one? You can try it in a for loop to verify |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
rjurado01
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it every time or only the very first one? You can try it in a for loop to verify