Files
klz-cables.com/.pnpm-store/v10/files/83/83564a4246c1e1fbdf7826575b4f14fa04ea5391b6df0388b5a612aa5baf0f61d7d3f2ab2397f2175ff05aa58964b3e24665c3bf288529628ef7b88debb12c
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

52 lines
1.9 KiB
Plaintext

import { describe, beforeEach, it, expect, vitest } from 'vitest';
import nodemailer from 'nodemailer';
import { nodemailerAdapter } from './index.js';
const defaultArgs = {
defaultFromAddress: 'test@test.com',
defaultFromName: 'Test'
};
describe('email-nodemailer', ()=>{
describe('transport verification', ()=>{
let mockedVerify;
let mockTransport;
beforeEach(()=>{
mockedVerify = vitest.fn();
mockTransport = nodemailer.createTransport({
name: 'existing-transport',
// eslint-disable-next-line @typescript-eslint/require-await, @typescript-eslint/no-misused-promises
send: async (mail)=>{
// eslint-disable-next-line no-console
console.log('mock send', mail);
},
verify: mockedVerify,
version: '0.0.1'
});
});
it('should be invoked when skipVerify = false', async ()=>{
await nodemailerAdapter({
...defaultArgs,
skipVerify: false,
transport: mockTransport
});
expect(mockedVerify.mock.calls).toHaveLength(1);
});
it('should be invoked when skipVerify is undefined', async ()=>{
await nodemailerAdapter({
...defaultArgs,
skipVerify: false,
transport: mockTransport
});
expect(mockedVerify.mock.calls).toHaveLength(1);
});
it('should not be invoked when skipVerify = true', async ()=>{
await nodemailerAdapter({
...defaultArgs,
skipVerify: true,
transport: mockTransport
});
expect(mockedVerify.mock.calls).toHaveLength(0);
});
});
});
//# sourceMappingURL=plugin.spec.js.map