Reorder jest mock and import statements for email mocking
This commit is contained in:
parent
31f0400df5
commit
d1bcf4f3ba
File diff suppressed because it is too large
Load Diff
|
@ -1,10 +1,9 @@
|
|||
jest.mock("nodemailer")
|
||||
const setup = require("./utilities")
|
||||
const sendMailMock = setup.emailMock()
|
||||
|
||||
const TENANT_ID = "default"
|
||||
|
||||
jest.mock("nodemailer")
|
||||
const sendMailMock = setup.emailMock()
|
||||
|
||||
describe("/api/global/auth", () => {
|
||||
let request = setup.getRequest()
|
||||
let config = setup.getConfig()
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
const setup = require("./utilities")
|
||||
|
||||
// mock the email system
|
||||
jest.mock("nodemailer")
|
||||
const nodemailer = require("nodemailer")
|
||||
nodemailer.createTransport.mockReturnValue({
|
||||
verify: jest.fn(),
|
||||
})
|
||||
const setup = require("./utilities")
|
||||
setup.emailMock()
|
||||
|
||||
describe("/api/global/configs/checklist", () => {
|
||||
let request = setup.getRequest()
|
||||
|
|
|
@ -1,16 +1,10 @@
|
|||
jest.mock("nodemailer")
|
||||
const setup = require("./utilities")
|
||||
const sendMailMock = setup.emailMock()
|
||||
|
||||
const { EmailTemplatePurpose } = require("../../../constants")
|
||||
const { TENANT_ID } = require("./utilities/structures")
|
||||
|
||||
// mock the email system
|
||||
const sendMailMock = jest.fn()
|
||||
jest.mock("nodemailer")
|
||||
const nodemailer = require("nodemailer")
|
||||
nodemailer.createTransport.mockReturnValue({
|
||||
sendMail: sendMailMock,
|
||||
verify: jest.fn(),
|
||||
})
|
||||
|
||||
describe("/api/global/email", () => {
|
||||
let request = setup.getRequest()
|
||||
let config = setup.getConfig()
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const setup = require("./utilities")
|
||||
const { TENANT_ID } = require("./utilities/structures")
|
||||
|
||||
jest.mock("nodemailer")
|
||||
const setup = require("./utilities")
|
||||
const sendMailMock = setup.emailMock()
|
||||
|
||||
describe("/api/global/users", () => {
|
||||
|
|
Loading…
Reference in New Issue