This commit is contained in:
olehhapuk
2026-12-01 12:12:13 +02:00
parent 6698ce32c7
commit ebf6ec2e39
67 changed files with 7317 additions and 1261 deletions
+33
View File
@@ -0,0 +1,33 @@
import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import request from 'supertest';
import { App } from 'supertest/types.js';
import { AppModule } from './../src/app.module.js';
describe('AppController (e2e)', () => {
let app: INestApplication<App>;
beforeEach(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();
app = moduleFixture.createNestApplication();
await app.init();
});
it('/ (GET)', () => {
return request(app.getHttpServer())
.get('/')
.expect(200)
.expect('Hello World!');
});
it('/me (GET) requires a session', () => {
return request(app.getHttpServer()).get('/me').expect(401);
});
afterEach(async () => {
await app.close();
});
});