https://github.com/mailslurp/examples
{
"scripts": {
"test": "npx codeceptjs run"
},
"dependencies": {
"@codeceptjs/mailslurp-helper": "^1.0.5",
"codeceptjs": "^2.3.0",
"mailslurp-client": "^15.0.1"
}
}
Feature('Example');
/**
* See https://codecept.io/ for more information
*/
Scenario('Can create a new inbox', async (I) => {
const mailbox = await I.haveNewMailbox();
await I.sendEmail({
to: [mailbox.emailAddress],
subject: 'Hello',
body: 'World'
});
await I.waitForLatestEmail(10);
await I.seeInEmailSubject('Hello');
await I.seeInEmailBody('World')
});
exports.config = {
tests: './*_test.js',
output: './output',
helpers: {
MailSlurp: {
apiKey: process.env.API_KEY,
require: '@codeceptjs/mailslurp-helper'
}
},
bootstrap: null,
mocha: {},
name: 'codeceptjs'
};
# CodeceptJS MailSlurp Example
This example demonstrates how to use [MailSlurp](https://www.mailslurp.com) with [CodeceptJS](https://codecept.io/) and the official [codeceptjs-mailslurp-helper](https://www.npmjs.com/package/@codeceptjs/mailslurp-helper).
### Setup
- Install NodeJS
### Running
```bash
API_KEY=your-api-key make test
```
node_modules:
npm install
test: node_modules
API_KEY=$(API_KEY) npm run test