Giter Club home page Giter Club logo

nodemailer-mock's Issues

Mock rejected emails

Is there the possibility to mock the array returned by SMTP transports that includes recipient addresses that were rejected by the server?

The presence of npm-shrinkwrap.json making shrink wrapping fail at the root module

Hi.
Thanks for providing this module.
Problem:
I am maintaining npm-shrinkwrap.json in my application. Now if I try install nodemailer-mock, my application's shrink wrapping is failing by giving many extraneous errors.
Example error:
npm WARN saveError extraneous: [email protected] /Users/sravankumarrekandar/workarea/nodemailer-test/node_modules/nodemailer-mock/node_modules/lodash.keys
..
The issue was fixed when I deleted both my-app/node_modules/nodemailer-mock/node_modules and my-app/node_modules/nodemailer-mock/npm-shrinkwrap.json
Then reinstalled my-app dependencies.
And everything is working fine.

However, we cannot maintain the hack. Please make sure the module is compatible with other apps.

Thanks.

Unwanted developer tools install

I installed and used this package. It works great but since it has developer-tools as a dependency, it wound up installing git hooks, and npm scripts as well as some .eslintrc, and other files. I didn't want the developer-tools package to install these files and settings. I imagine other's wouldn't want it either.

Is the developer-tools package needed? If so, can a note be added to the README to mention that it uses the package and to expect some files and settings to be installed? Or even an option to add/remove the package?

Thanks

Add support for sendMail()'s Promise return value

Nodemailer conveniently provides a Promise wrapper for sendMail() (see the note at the bottom of https://nodemailer.com/usage/, If callback argument is not set then the method returns a Promise object.

The mock sendMail() only provides the callback-based interface, without the Promise wrapper.

Would you accept a PR to add the Promise wrapper, to have the same semantics as nodemailer's?

Cannot set property 'mailer' of undefined

When trying to use nodemailer-mock, I get this error:

Cannot set property 'mailer' of undefined

Repro:

npm init -y
yarn add nodemailer
yarn add nodemailer-mock --dev

index.js:

const nodemailerMock = require('nodemailer-mock');
const transport = nodemailerMock.createTransport();
node index.js

Result:

/Users/alexzeitler/src/spikes/nodemailer-mock-spike/node_modules/nodemailer-mock/node_modules/nodemailer/lib/mailer/index.js:45
        this.transporter.mailer = this;
                                ^

TypeError: Cannot set property 'mailer' of undefined
    at new Mail (/Users/alexzeitler/src/spikes/nodemailer-mock-spike/node_modules/nodemailer-mock/node_modules/nodemailer/lib/mailer/index.js:45:33)
    at Object.module.exports.createTransport (/Users/alexzeitler/src/spikes/nodemailer-mock-spike/node_modules/nodemailer-mock/node_modules/nodemailer/lib/nodemailer.js:58:14)
    at Object.createTransport (/Users/alexzeitler/src/spikes/nodemailer-mock-spike/node_modules/nodemailer-mock/nodemailer-mock.js:48:28)
    at Object.<anonymous> (/Users/alexzeitler/src/spikes/nodemailer-mock-spike/index.js:2:34)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)

Node.js version : 10.15.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.