feat(nestjs): migrate to NestJS

This commit is contained in:
Ahmed Bouhuolia
2025-04-07 11:51:24 +02:00
parent f068218a16
commit 55fcc908ef
3779 changed files with 631 additions and 195332 deletions

View File

@@ -0,0 +1,59 @@
import * as request from 'supertest';
import { faker } from '@faker-js/faker';
import { app } from './init-app-test';
describe('Authentication (e2e)', () => {
beforeAll(async () => {});
it('should signup success', () => {
return request(app.getHttpServer())
.post('/auth/signup')
.send({
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
email: faker.internet.email(),
password: '123123123',
})
.expect(201);
});
it('should signin success', () => {
const signupBody = {
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
email: faker.internet.email(),
password: '123123123',
};
const response = request(app.getHttpServer())
.post('/auth/signup')
.send(signupBody);
request(app.getHttpServer())
.post('/auth/signin')
.send({
email: signupBody.email,
password: signupBody.password,
})
.expect(201);
});
it('should send reset password success', () => {
const signupBody = {
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
email: faker.internet.email(),
password: '123123123',
};
const signupResponse = request(app.getHttpServer())
.post('/auth/signup')
.send(signupBody);
request(app.getHttpServer())
.post('/auth/send_reset_password')
.send({
email: signupBody.email,
})
.expect(201);
});
});