How to use the haraka-test-fixtures.connection 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);
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 / 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 / helo.checks.js View on Github external
const _set_up = function (done) {

    this.plugin = new fixtures.plugin('helo.checks');
    this.plugin.config.root_path = path.resolve(__dirname, '../../config');

    this.connection = fixtures.connection.createConnection();
    this.connection.remote.ip='208.75.199.19';

    this.plugin.register();

    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 / dkim_sign.js View on Github external
'use strict';

const fs           = require('fs');
const path         = require('path');

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

const Connection   = fixtures.connection;

const _set_up = function (done) {

    this.plugin = new fixtures.plugin('dkim_sign');
    this.plugin.cfg = { main: { } };

    this.connection = Connection.createConnection();
    this.connection.init_transaction();
    this.connection.transaction.mail_from = {};

    done();
}

exports.get_sender_domain = {
    setUp : _set_up,
    'no transaction': function (test) {
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 / 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();
        callback();
    },
    'relay.acl=false' (test) {
github haraka / Haraka / tests / plugins / connect.geoip.js View on Github external
'use strict';

var fixtures     = require('haraka-test-fixtures');

var Connection   = fixtures.connection;

var _set_up = function (done) {
    this.plugin = new fixtures.plugin('connect.geoip');
    this.plugin.load_geoip_ini();
    this.connection = Connection.createConnection();
    done();
};

exports.register = {
    setUp : function (done) {
        this.plugin = new fixtures.plugin('connect.geoip');

        try { this.plugin.mm_loads = require('maxmind'); }
        catch (ignore) {}
        try { this.plugin.gl_loads = require('geoip-lite'); }
        catch (ignore) {}
github haraka / Haraka / tests / plugins / clamd.js View on Github external
'use strict';

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

const Connection   = fixtures.connection;

function _set_up (done) {

    this.plugin = new fixtures.plugin('clamd');
    this.plugin.register();

    this.connection = Connection.createConnection();
    this.connection.init_transaction();

    done();
}

exports.load_clamd_ini = {
    setUp : _set_up,
    'none' (test) {
        test.expect(1);

haraka-test-fixtures

Haraka Test Fixtures

MIT
Latest version published 1 month ago

Package Health Score

64 / 100
Full package analysis

Similar packages