haraka / test-fixtures

Fixtures for testing Haraka and plugins
https://www.npmjs.com/package/haraka-test-fixtures
MIT License
2 stars 6 forks source link
haraka test-automation testing

Build Status Code Coverage Code Climate

NPM

haraka-test-fixtures

Fixtures for testing Haraka and plugins

Usage

const fixtures = require('haraka-test-fixtures')

A common pattern

beforeEach(() => {
  this.plugin = new fixtures.plugin('pluginName')

  this.connection = fixtures.connection.createConnection()
  this.connection.init_transaction()
})

describe('pluginName', () => {
  it('registers', () => {
    this.plugin.register()
  })
})

Exports the following fixture types:

These fixtures are analogs of their like-named siblings in Haraka with varying levels of completeness. If there are functions necessary to enhance your ability to test, please do add them.