Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package is not working properly in test mode #23

Open
ksendra opened this issue May 25, 2017 · 2 comments
Open

Package is not working properly in test mode #23

ksendra opened this issue May 25, 2017 · 2 comments

Comments

@ksendra
Copy link

ksendra commented May 25, 2017

Hi, I'm trying to run meteor tests to test some of functionality that uses Your Mandrill package - and it seems that the package does not load correctly in test mode. I'm using practicalmeteor:mocha for tests.
Mandrill.messages.sendTemplate usage returns 'Cannot read property 'sendTemplate' of undefined' and the console.log of Mandrill returns { options: {}, config: [Function], sendTemplate: [Function] } while in non-test mode it's much larger.
Any suggestions on how to get this working?

@Floriferous
Copy link

Running into this issue as well, wonder why sendTemplate is now part of the Mandrill object.

@Floriferous
Copy link

In case anyone is wondering, you need to explicitly call Mandrill.config({ ...yourOptions }) before your tests, as meteor won't load the file where you are doing this for the non-test app.

So simply import it in a place that gets run before your tests start. This would be a working hack:

Mandrill.config({});

describe('my email tests', () => {
  it('works', () => {
    // Your tests
  })
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants