From c480f2f030b6aefae42c54b0ed6092cebdf38f29 Mon Sep 17 00:00:00 2001 From: Gsk54 Date: Thu, 5 Jan 2023 17:30:19 +0100 Subject: [PATCH] fix env --- .env.dist | 1 + .env.test | 1 + .../users/tests/integration/users.repository.spec.ts | 12 ++++++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.env.dist b/.env.dist index 8f0776d..63d7ff5 100644 --- a/.env.dist +++ b/.env.dist @@ -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" diff --git a/.env.test b/.env.test index bc06f04..f3790b9 100644 --- a/.env.test +++ b/.env.test @@ -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" diff --git a/src/modules/users/tests/integration/users.repository.spec.ts b/src/modules/users/tests/integration/users.repository.spec.ts index c6df393..c4b221a 100644 --- a/src/modules/users/tests/integration/users.repository.spec.ts +++ b/src/modules/users/tests/integration/users.repository.spec.ts @@ -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); }); });