Adding functionality to check if ethereal is down, if it is don't fail the test.
This commit is contained in:
parent
183b6e7b50
commit
fab766adb6
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue