Skip to content

Commit de655dc

Browse files
committed
wait for health
1 parent 4c7e99a commit de655dc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test_ldap/ldap.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@ const wrongLoginData: UserLoginRequestDto = {
1414
};
1515

1616
describe('Ldap', () => {
17+
beforeAll(async () => {
18+
const retries = 5;
19+
for (let attempt = 1; attempt <= retries; attempt++) {
20+
try {
21+
await axios.get('/health');
22+
} catch (error) {
23+
if (attempt < retries) {
24+
await new Promise((resolve) => setTimeout(resolve, 1_000));
25+
} else {
26+
throw error;
27+
}
28+
}
29+
}
30+
});
31+
1732
test('Sucessful login', async () => {
1833
const response = await axios.post<UserLoginResponseDto>('/users/login', loginData);
1934

0 commit comments

Comments
 (0)