Add timeout to node mailer, lower than jest default
This commit is contained in:
parent
f7dd62cbc2
commit
55599c0a50
|
@ -3,9 +3,6 @@ const { EmailTemplatePurpose } = require("../../../constants")
|
||||||
const nodemailer = require("nodemailer")
|
const nodemailer = require("nodemailer")
|
||||||
const fetch = require("node-fetch")
|
const fetch = require("node-fetch")
|
||||||
|
|
||||||
// need a longer timeout for getting these
|
|
||||||
jest.setTimeout(30000)
|
|
||||||
|
|
||||||
describe("/api/global/email", () => {
|
describe("/api/global/email", () => {
|
||||||
let request = setup.getRequest()
|
let request = setup.getRequest()
|
||||||
let config = setup.getConfig()
|
let config = setup.getConfig()
|
||||||
|
|
|
@ -234,6 +234,7 @@ class TestConfiguration {
|
||||||
user: "don.bahringer@ethereal.email",
|
user: "don.bahringer@ethereal.email",
|
||||||
pass: "yCKSH8rWyUPbnhGYk9",
|
pass: "yCKSH8rWyUPbnhGYk9",
|
||||||
},
|
},
|
||||||
|
connectionTimeout: 1000, // must be less than the jest default of 5000
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
|
|
|
@ -35,6 +35,9 @@ function createSMTPTransport(config) {
|
||||||
options.tls = {
|
options.tls = {
|
||||||
rejectUnauthorized: false,
|
rejectUnauthorized: false,
|
||||||
}
|
}
|
||||||
|
if (config.connectionTimeout) {
|
||||||
|
options.connectionTimeout = config.connectionTimeout
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
options = {
|
options = {
|
||||||
port: 587,
|
port: 587,
|
||||||
|
|
Loading…
Reference in New Issue