Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit e132823

Browse files
added a small delay to getTokenFromMail test method to prevent issues
1 parent 3b69b34 commit e132823

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/services/auth-management.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,19 @@ describe('\'authManagement\' service', () => {
5757
});
5858
});
5959

60+
const waitFor = (ms) => {
61+
return new Promise((resolve) => {
62+
setTimeout(() => {
63+
resolve();
64+
}, ms);
65+
});
66+
};
67+
6068
const getTokenFromMail = async () => {
6169
// Get token from tmp email file
6270
const mailDir = path.join(__dirname, '../../tmp/emails');
71+
// wait for the mail to be created first
72+
await waitFor(50);
6373
const fileName = await fs.readdirSync(mailDir)[0];
6474
const mailFile = path.join(mailDir, fileName);
6575
const mailContent = await fs.readFileSync(mailFile, 'utf8');

0 commit comments

Comments
 (0)