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