{"id":16345546,"url":"https://github.com/workflow/meteor-mandrill-stub","last_synced_at":"2025-11-07T15:30:28.056Z","repository":{"id":97622229,"uuid":"46614642","full_name":"workflow/meteor-mandrill-stub","owner":"workflow","description":"A stub for Mandrill API calls, used in testing meteor apps.","archived":false,"fork":false,"pushed_at":"2015-11-25T23:30:34.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-27T22:25:25.133Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/workflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-21T12:36:31.000Z","updated_at":"2015-11-21T12:48:39.000Z","dependencies_parsed_at":"2023-03-10T07:28:35.957Z","dependency_job_id":null,"html_url":"https://github.com/workflow/meteor-mandrill-stub","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workflow%2Fmeteor-mandrill-stub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workflow%2Fmeteor-mandrill-stub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workflow%2Fmeteor-mandrill-stub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workflow%2Fmeteor-mandrill-stub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workflow","download_url":"https://codeload.github.com/workflow/meteor-mandrill-stub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239533067,"owners_count":19654617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T00:32:15.863Z","updated_at":"2025-11-07T15:30:27.975Z","avatar_url":"https://github.com/workflow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mandrill-stub\n\nA stub for use in testing Meteor apps.\nIt's also nice for reducing your dependencies in local development. \n\nWorks on top of the excellent [wylio:mandrill](https://github.com/Wylio/meteor-mandrill) package.\n\n\n## Usage:\n\nIf you are using `wylio:mandrill`, add this package like this:\n\n`meteor add dropz:mandrill-stub`\n\nYour app will no longer send real API calls to Mandrill in development mode and will instead log your API calls to a local mongoDB collection, from where you can assert on the existence and correctness of your calls.\n\nThe stubbing happens automatically.\n \nThis package does not affect production as it is a `debugOnly` package.\n\n\n### Currently Stubbed API Calls\n\n * `Mandrill.messages.sendTemplate`\n \n * Can add more if needed\n\n\n### Asserting on Successful Mandrill API Calls\n\n```js\nMeteor.call('mandrillStub/getAPICalls')\n```\n\nIn case one or more API calls would've been made, you'll get a response like\n\n```json\n{\n    \"_id\" : \"rTkLCM4L3b9n79axD\",\n    \"key\" : \"SOME KEY\",\n    \"template_name\" : \"thank-you-for-suggesting-a-company\",\n    \"template_content\" : null,\n    \"message\" : {\n        \"global_merge_vars\" : [ \n            {\n                \"name\" : \"firstName\",\n                \"content\" : \"Florian\"\n            }, \n            {\n                \"name\" : \"companyName\",\n                \"content\" : \"dropz\"\n            }\n        ],\n        \"to\" : [ \n            {\n                \"email\" : \"flo@dropz.io\"\n            }\n        ]\n    }\n}\n```\n\n...for each of them.\n\n### Resetting your local DB Log of API Calls\n\n```js\nMeteor.call('mandrillStub/reset');\n```\n\nIf using cucumber, it's a good idea to do that in a reset hook after every Scenario.\n\n\n### What if I want to test email sending in development mode?\n\nYou can disable the stub whenever you want to do actual Mandrill calls in development, by setting the `DEBUG_MANDRILL_EMAILS=1` environment variable prior to starting up meteor.\n\n\n### What if I want to dance a haka?\n\nNothing's stopping you, mate!\n\n\n## Thanks\n\nInspired by [xolvio:meteor-email-stub](https://github.com/xolvio/meteor-github-stub) and all of Xolvio's amazing work on providing a great testing experience in the Meteor landscape. Thanks!\n\nRequires [wylio:mandrill](https://github.com/Wylio/meteor-mandrill). Thx for that package!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkflow%2Fmeteor-mandrill-stub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkflow%2Fmeteor-mandrill-stub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkflow%2Fmeteor-mandrill-stub/lists"}