1
0
Fork 0
mirror of synced 2024-06-22 04:10:54 +12:00

Adding functionality to check if ethereal is down, if it is don't fail the test.

This commit is contained in:
mike12345567 2021-10-07 16:11:33 +01:00
parent 183b6e7b50
commit fab766adb6

View file

@ -34,8 +34,18 @@ describe("/api/global/email", () => {
const testUrl = nodemailer.getTestMessageUrl(res.body)
console.log(`${purpose} URL: ${testUrl}`)
expect(testUrl).toBeDefined()
const response = await fetch(testUrl)
const text = await response.text()
let response, text
try {
response = await fetch(testUrl)
text = await response.text()
} catch (err) {
// ethereal hiccup, can't test right now
if (err.status > 400) {
return
} else {
throw err
}
}
let toCheckFor
switch (purpose) {
case EmailTemplatePurpose.WELCOME: