How to use the haraka-test-fixtures.result_store 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 / result_store.js View on Github external
var fixtures     = require('haraka-test-fixtures');
var Connection   = fixtures.connection;
var ResultStore  = fixtures.result_store;

function _set_up(callback) {
    this.connection = Connection.createConnection();
    this.connection.results = new ResultStore(this.connection);
    callback();
}
function _tear_down(callback) {
    callback();
}

exports.default_result = {
    setUp : _set_up,
    tearDown : _tear_down,
    'init add' : function (test) {
        test.expect(1);
        this.connection.results.add('test_plugin', { pass: 'test pass' });
github haraka / Haraka / tests / plugins / karma.js View on Github external
'use strict';

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

var Connection   = fixtures.connection;
var ResultStore  = fixtures.result_store;
var stub         = fixtures.stub.stub;

var _set_up = function (done) {

    this.plugin = new fixtures.plugin('karma');

    this.plugin.cfg = { main: {} };
    this.plugin.deny_hooks = {'connect': true};
    this.plugin.tarpit_hooks = ['connect'];

    this.connection = Connection.createConnection({}, { notes: {} });

    this.connection.transaction = stub;
    this.connection.transaction.results = new ResultStore(this.plugin);

    done();

haraka-test-fixtures

Haraka Test Fixtures

MIT
Latest version published 1 month ago

Package Health Score

64 / 100
Full package analysis

Similar packages