crazymail
A crazy simple SMTP server designed for autmated testing of web applications
Last updated 4 years ago by koopero .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install crazymail -g
SYNC missed versions from official npm registry.

Crazymail is a simple SMTP mail server designed to aide automated testing of web applications. It receives email all incoming mail on port 25 and makes it available to a client over HTTP.

Example

Server setup

# On publicly facing server example.com
npm install -g crazymail

# sudo is needed to listen on port 25
sudo crazymail server --host example.com

Your test

var Crazymail = require('crazymail')

// Assuming there is a Crazymail server at 'example.com'
var Crazyclient = new Crazymail.Client( {
  host: 'example.com'
})

var person = Crazyclient.random.person()
// person will be look something like this:
{
  firstName: 'Hans',
  lastName: 'Flounder',
  name: 'Hans Flounder',
  address: 'hans_flounder_678@example.com',
  host: 'example.com'
}

// Now perform your automated tests.
// You can use the random funny names to fill out your forms.
your_automated_test( person )

// Receive email sent to `person`
// You need not worry about the timing of this call.
// The server will cache the message for a reasonable
// amount of time and keep the connection open
// if it hasn't arrived yet.
Crazyclient.receive( person )
  .then( function ( message ) {
    console.log( 'You got mail!', message )
  })
  .catch( function ( err ) {
    console.log( 'Something went wrong.')
  })

Current Tags

  • 0.6.0                                ...           latest (4 years ago)

11 Versions

  • 0.6.0                                ...           4 years ago
  • 0.5.3                                ...           4 years ago
  • 0.5.2                                ...           4 years ago
  • 0.5.1                                ...           5 years ago
  • 0.4.3                                ...           5 years ago
  • 0.4.2                                ...           5 years ago
  • 0.4.1                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
  • 0.3.0                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 2
Dependencies (12)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |