This commit is contained in:
Gsk54 2023-01-05 17:30:19 +01:00
parent 33f6b11089
commit c480f2f030
3 changed files with 12 additions and 2 deletions

View File

@ -1,5 +1,6 @@
# SERVICE
SERVICE_URL=0.0.0.0
SERVICE_PORT=5001
# PRISMA
DATABASE_URL="postgresql://user:user@v3-user-db:5432/user?schema=public"

View File

@ -1,5 +1,6 @@
# SERVICE
SERVICE_URL=0.0.0.0
SERVICE_PORT=5001
# PRISMA
DATABASE_URL="postgresql://user:user@localhost:5601/user?schema=public"

View File

@ -46,10 +46,18 @@ describe('UsersRepository', () => {
});
});
it('should return an data array with users', async () => {
await createUsers(10);
it('should return a data array with 8 users', async () => {
await createUsers(8);
const users = await usersRepository.findAll();
expect(users.data.length).toBe(8);
expect(users.total).toBe(8);
});
it('should return a data array limited to 10 users', async () => {
await createUsers(20);
const users = await usersRepository.findAll();
expect(users.data.length).toBe(10);
expect(users.total).toBe(20);
});
});