Fixing another issue with ethereal test package.
This commit is contained in:
parent
efb09523a7
commit
52b44736c5
|
@ -17,11 +17,11 @@ describe("/api/global/email", () => {
|
||||||
afterAll(setup.afterAll)
|
afterAll(setup.afterAll)
|
||||||
|
|
||||||
async function sendRealEmail(purpose) {
|
async function sendRealEmail(purpose) {
|
||||||
|
let response, text
|
||||||
|
try {
|
||||||
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({
|
||||||
|
@ -40,7 +40,7 @@ describe("/api/global/email", () => {
|
||||||
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 (parseInt(err.status) > 400) {
|
if (parseInt(err.status) >= 400) {
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
throw err
|
throw err
|
||||||
|
|
|
@ -38,6 +38,9 @@ class TestConfiguration {
|
||||||
request.request = {
|
request.request = {
|
||||||
body: config,
|
body: config,
|
||||||
}
|
}
|
||||||
|
request.throw = (status, err) => {
|
||||||
|
throw { status, message: err }
|
||||||
|
}
|
||||||
if (params) {
|
if (params) {
|
||||||
request.params = params
|
request.params = params
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue