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
1 line
3.0 KiB
Plaintext
1 line
3.0 KiB
Plaintext
{"version":3,"sources":["../src/plugin.spec.ts"],"sourcesContent":["import type { Transporter } from 'nodemailer'\nimport { describe, beforeEach, it, expect, Mock, vitest } from 'vitest'\n\nimport nodemailer from 'nodemailer'\n\nimport type { NodemailerAdapterArgs } from './index.js'\n\nimport { nodemailerAdapter } from './index.js'\n\nconst defaultArgs: NodemailerAdapterArgs = {\n defaultFromAddress: 'test@test.com',\n defaultFromName: 'Test',\n}\n\ndescribe('email-nodemailer', () => {\n describe('transport verification', () => {\n let mockedVerify: Mock<Transporter['verify']>\n let mockTransport: Transporter\n\n beforeEach(() => {\n mockedVerify = vitest.fn()\n mockTransport = nodemailer.createTransport({\n name: 'existing-transport',\n // eslint-disable-next-line @typescript-eslint/require-await, @typescript-eslint/no-misused-promises\n send: async (mail) => {\n // eslint-disable-next-line no-console\n console.log('mock send', mail)\n },\n verify: mockedVerify,\n version: '0.0.1',\n })\n })\n\n it('should be invoked when skipVerify = false', async () => {\n await nodemailerAdapter({\n ...defaultArgs,\n skipVerify: false,\n transport: mockTransport,\n })\n\n expect(mockedVerify.mock.calls).toHaveLength(1)\n })\n\n it('should be invoked when skipVerify is undefined', async () => {\n await nodemailerAdapter({\n ...defaultArgs,\n skipVerify: false,\n transport: mockTransport,\n })\n\n expect(mockedVerify.mock.calls).toHaveLength(1)\n })\n\n it('should not be invoked when skipVerify = true', async () => {\n await nodemailerAdapter({\n ...defaultArgs,\n skipVerify: true,\n transport: mockTransport,\n })\n\n expect(mockedVerify.mock.calls).toHaveLength(0)\n })\n })\n})\n"],"names":["describe","beforeEach","it","expect","vitest","nodemailer","nodemailerAdapter","defaultArgs","defaultFromAddress","defaultFromName","mockedVerify","mockTransport","fn","createTransport","name","send","mail","console","log","verify","version","skipVerify","transport","mock","calls","toHaveLength"],"mappings":"AACA,SAASA,QAAQ,EAAEC,UAAU,EAAEC,EAAE,EAAEC,MAAM,EAAQC,MAAM,QAAQ,SAAQ;AAEvE,OAAOC,gBAAgB,aAAY;AAInC,SAASC,iBAAiB,QAAQ,aAAY;AAE9C,MAAMC,cAAqC;IACzCC,oBAAoB;IACpBC,iBAAiB;AACnB;AAEAT,SAAS,oBAAoB;IAC3BA,SAAS,0BAA0B;QACjC,IAAIU;QACJ,IAAIC;QAEJV,WAAW;YACTS,eAAeN,OAAOQ,EAAE;YACxBD,gBAAgBN,WAAWQ,eAAe,CAAC;gBACzCC,MAAM;gBACN,oGAAoG;gBACpGC,MAAM,OAAOC;oBACX,sCAAsC;oBACtCC,QAAQC,GAAG,CAAC,aAAaF;gBAC3B;gBACAG,QAAQT;gBACRU,SAAS;YACX;QACF;QAEAlB,GAAG,6CAA6C;YAC9C,MAAMI,kBAAkB;gBACtB,GAAGC,WAAW;gBACdc,YAAY;gBACZC,WAAWX;YACb;YAEAR,OAAOO,aAAaa,IAAI,CAACC,KAAK,EAAEC,YAAY,CAAC;QAC/C;QAEAvB,GAAG,kDAAkD;YACnD,MAAMI,kBAAkB;gBACtB,GAAGC,WAAW;gBACdc,YAAY;gBACZC,WAAWX;YACb;YAEAR,OAAOO,aAAaa,IAAI,CAACC,KAAK,EAAEC,YAAY,CAAC;QAC/C;QAEAvB,GAAG,gDAAgD;YACjD,MAAMI,kBAAkB;gBACtB,GAAGC,WAAW;gBACdc,YAAY;gBACZC,WAAWX;YACb;YAEAR,OAAOO,aAAaa,IAAI,CAACC,KAAK,EAAEC,YAAY,CAAC;QAC/C;IACF;AACF"} |