Fixing a small issue with email test fix.
This commit is contained in:
parent
64b98a6d18
commit
a4014c5580
|
@ -20,6 +20,8 @@ describe("/api/global/email", () => {
|
||||||
await config.saveEtherealSmtpConfig()
|
await config.saveEtherealSmtpConfig()
|
||||||
await config.saveSettingsConfig()
|
await config.saveSettingsConfig()
|
||||||
const user = await config.getUser("test@test.com")
|
const user = await config.getUser("test@test.com")
|
||||||
|
let response, text
|
||||||
|
try {
|
||||||
const res = await request
|
const res = await request
|
||||||
.post(`/api/global/email/send`)
|
.post(`/api/global/email/send`)
|
||||||
.send({
|
.send({
|
||||||
|
@ -34,13 +36,11 @@ 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()
|
||||||
let response, text
|
|
||||||
try {
|
|
||||||
response = await fetch(testUrl)
|
response = await fetch(testUrl)
|
||||||
text = await response.text()
|
text = await response.text()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// ethereal hiccup, can't test right now
|
// ethereal hiccup, can't test right now
|
||||||
if (err.status > 400) {
|
if (parseInt(err.status) > 400) {
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
throw err
|
throw err
|
||||||
|
|
Loading…
Reference in New Issue