How to use the haraka-test-fixtures.results 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 / rcpt_to.routes.js View on Github external
var _set_up_redis = function (done) {

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

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

    this.plugin.register();
    this.plugin.server = { notes: { } };
    this.plugin.redisCfg.opts.retry_strategy = function (options) {
        return;
    };

    var t = this;
    this.plugin.init_redis_shared(function (err) {
        if (err) {
            console.error(err.message);
            return done();
        }

        t.plugin.db = t.plugin.server.notes.redis;
        t.plugin.redis_ping(function (err2, result) {
github haraka / Haraka / tests / plugins / data.headers.js View on Github external
function _set_up (done) {

    this.plugin = new fixtures.plugin('data.headers');

    this.plugin.register();

    try {
        this.plugin.addrparser = require('address-rfc2822');
    }
    catch (ignore) {}

    this.connection = fixtures.connection.createConnection();

    this.connection.transaction = {
        header: new Header(),
        results: new fixtures.results(this.plugin),
        rcpt_to: [],
    };

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

    this.plugin = new fixtures.plugin('access');
    this.plugin.config.module_config(path.resolve(__dirname, 'config'));
    this.plugin.register();

    this.connection = fixtures.connection.createConnection();
    this.connection.transaction = {
        results: new fixtures.results(this.connection),
    };

    done();
};
github haraka / Haraka / tests / plugins / greylist.js View on Github external
this.plugin.register();
    this.plugin.whitelist = {
        "mail":{"josef@example.com":true},
        "rcpt":{"josef@example.net":true},
        "ip":[
            ipaddr.parseCIDR('123.123.123.234/32'),
            ipaddr.parseCIDR('2a02:8204:d600:8060:7920:4040:20ee:9680/128'),
            ipaddr.parseCIDR('123.210.123.234/27'),
            ipaddr.parseCIDR('2a02:8204:d600:8060:7920:eeee::/96'),
        ]
    };
    this.plugin.list = {"dyndom":["sgvps.net"]};

    this.connection = fixtures.connection.createConnection();
    this.connection.transaction = {
        results: new fixtures.results(this.connection),
    };

    done();
}
github haraka / Haraka / tests / plugins / deprecated / relay_acl.js View on Github external
function _set_up (done) {

    this.plugin = new fixtures.plugin('relay_acl');
    this.plugin.cfg = {};

    this.connection = fixtures.connection.createConnection();
    this.connection.transaction = {
        results: new fixtures.results(this.connection),
    };

    done();
}
github haraka / Haraka / tests / plugins / rcpt_to.in_host_list.js View on Github external
function _set_up (done) {

    this.plugin = new fixtures.plugin('rcpt_to.in_host_list');
    this.plugin.inherits('rcpt_to.host_list_base');
    this.plugin.cfg = {};
    this.plugin.host_list = {};

    this.connection = fixtures.connection.createConnection();
    this.connection.transaction = {
        results: new fixtures.results(this.connection),
        notes: {},
    };

    done();
}
github haraka / Haraka / tests / plugins / rcpt_to.ldap.js View on Github external
const _set_up = function (done) {

    this.plugin = new fixtures.plugin('rcpt_to.ldap');
    this.plugin.inherits('rcpt_to.host_list_base');

    this.plugin.cfg = {};
    this.plugin.host_list = {};
    this.connection = fixtures.connection.createConnection();
    this.connection.transaction = {
        results: new fixtures.results(this.connection),
        notes: {},
        rcpt_to: [new Address('test@test.com')]
    };

    done();
};
github haraka / Haraka / tests / plugins / mail_from.is_resolvable.js View on Github external
const _set_up = function (done) {

    this.plugin = new fixtures.plugin('mail_from.is_resolvable');
    this.plugin.register();

    this.connection = fixtures.connection.createConnection();

    this.connection.transaction = {
        notes: {},
        results: new fixtures.results(this.plugin),
    };

    done();
}
github haraka / Haraka / tests / plugins / relay.js View on Github external
setUp (callback) {
        this.plugin = new fixtures.plugin('relay');
        this.plugin.cfg = { relay: { dest_domains: true } };

        this.connection = fixtures.connection.createConnection();
        this.connection.transaction = {
            results: new fixtures.results(this.connection),
        };

        callback();
    },
    'relay.dest_domains=false' (test) {
github haraka / Haraka / tests / plugins / bounce.js View on Github external
bad_rcpt: true,
            non_local_msgid: true,
        },
        reject: {
            single_recipient:true,
            empty_return_path:true,
            non_local_msgid:true,
        },
        invalid_addrs: { 'test@bad1.com': true, 'test@bad2.com': true },
    };

    this.connection = Connection.createConnection();
    this.connection.remote.ip = '8.8.8.8';
    this.connection.transaction = {
        header: new Header(),
        results: new fixtures.results(this.plugin),
    };

    done();
}

haraka-test-fixtures

Haraka Test Fixtures

MIT
Latest version published 11 days ago

Package Health Score

70 / 100
Full package analysis

Similar packages