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)
|
const testUrl = nodemailer.getTestMessageUrl(res.body)
|
||||||
console.log(`${purpose} URL: ${testUrl}`)
|
console.log(`${purpose} URL: ${testUrl}`)
|
||||||
expect(testUrl).toBeDefined()
|
expect(testUrl).toBeDefined()
|
||||||
const response = await fetch(testUrl)
|
let response, text
|
||||||
const text = await 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
|
let toCheckFor
|
||||||
switch (purpose) {
|
switch (purpose) {
|
||||||
case EmailTemplatePurpose.WELCOME:
|
case EmailTemplatePurpose.WELCOME:
|
||||||
|
|
Loading…
Reference in New Issue