1
0
Fork 0
mirror of synced 2024-06-28 02:50:50 +12:00

Fixing a small issue with email test fix.

This commit is contained in:
mike12345567 2021-10-07 16:14:00 +01:00
parent fab766adb6
commit efb09523a7

View file

@ -20,6 +20,8 @@ describe("/api/global/email", () => {
await config.saveEtherealSmtpConfig()
await config.saveSettingsConfig()
const user = await config.getUser("test@test.com")
let response, text
try {
const res = await request
.post(`/api/global/email/send`)
.send({
@ -34,13 +36,11 @@ describe("/api/global/email", () => {
const testUrl = nodemailer.getTestMessageUrl(res.body)
console.log(`${purpose} URL: ${testUrl}`)
expect(testUrl).toBeDefined()
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) {
if (parseInt(err.status) > 400) {
return
} else {
throw err