How to use the haraka-test-fixtures.transaction function in haraka-test-fixtures

To help you get started, we’ve selected a few haraka-test-fixtures examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github haraka / Haraka / tests / plugins / rspamd.js View on Github external
'use strict';

// var Address      = require('address-rfc2821');
const fixtures     = require('haraka-test-fixtures');

const Connection   = fixtures.connection;
const Transaction  = fixtures.transaction;

const _set_up = function (done) {

    this.plugin = new fixtures.plugin('rspamd');
    this.plugin.register();
    this.connection = Connection.createConnection();
    this.connection.transaction = Transaction.createTransaction();

    done();
};

exports.register = {
    setUp : _set_up,
    'loads the rspamd plugin': function (test) {
        test.expect(1);
        test.equal('rspamd', this.plugin.name);
github haraka / Haraka / tests / plugins / spf.js View on Github external
const _set_up = function (done) {

    this.plugin = new fixtures.plugin('spf');
    this.plugin.timeout = 8000;
    this.plugin.load_spf_ini();

    // uncomment this line to see detailed SPF evaluation
    this.plugin.SPF.prototype.log_debug = () => {};

    this.connection = fixtures.connection.createConnection();
    this.connection.transaction = fixtures.transaction.createTransaction();
    this.connection.transaction.results = new fixtures.results(this.connection);

    done();
}
github haraka / Haraka / tests / plugins / queue / smtp_forward.js View on Github external
function _setup (done) {
    this.plugin = new fixtures.plugin('queue/smtp_forward');

    // switch config directory to 'tests/config'
    this.plugin.config = this.plugin.config.module_config(path.resolve('tests'));

    this.plugin.register();

    this.connection = new fixtures.connection.createConnection();
    this.connection.transaction = new fixtures.transaction.createTransaction();

    done();
}
github haraka / Haraka / tests / plugins / rcpt_to.routes.js View on Github external
var _set_up_file = function (done) {

    this.server = {};
    this.plugin = new fixtures.plugin('rcpt_to.routes');

    this.plugin.register();
    this.connection = fixtures.connection.createConnection();
    this.connection.transaction = fixtures.transaction.createTransaction();
    this.connection.transaction.results = new fixtures.results(this.connection);

    done();
};

haraka-test-fixtures

Haraka Test Fixtures

MIT
Latest version published 3 months ago

Package Health Score

62 / 100
Full package analysis

Similar packages