How to use the a.requireMock function in a

To help you get started, we’ve selected a few a 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 alfateam / rdb / table / commands / pushCommandSpec / push.js View on Github external
function act(c){
	c.mock = a.mock;
	c.getChangeSet = a.requireMock('./getChangeSet');	
	c.changeSet = {};
	c.command = {};
	c.changeSet.push = c.mock();
	c.changeSet.push.expect(c.command);
	c.getChangeSet.expect().return(c.changeSet);


	require('../pushCommand')(c.command);
}
github alfateam / rdb / table / columnSpec / new / integer.js View on Github external
function act(c) {
	var add = requireMock('./column/integer');
	add.expect(c.column);
	c.integer = add;
	c.returned = c.sut.integer();
}
github alfateam / rdb / table / commands / getChangeSetSpec / get.js View on Github external
function act(c){
	c.changeSet = {};
	c.getSessionSingleton = a.requireMock('../getSessionSingleton');
	c.getSessionSingleton.expect('changes').return(c.changeSet);

	c.returned = require('../getChangeSet')();
}
github alfateam / rdb / table / column / numeric / newEncodeSpec / new.js View on Github external
function act(c) {
	c.arg = {};
	c.column = column;
	c.purify = requireMock('./purify');

	c.newParam = requireMock('../../query/newParameterized');

	c.sut = require('../newEncode')(column);
}
github alfateam / rdb / table / column / float / newEncodeSpec / new.js View on Github external
function act(c) {
	c.arg = {};
	c.column = column;
	c.purify = requireMock('./purify');

	c.newParam = requireMock('../../query/newParameterized');

	c.sut = require('../newEncode')(column);
}
github alfateam / rdb / table / query / newParameterizedSpec / req / new / append_text.js View on Github external
var requireMock = require('a').requireMock;
var newParameterized = requireMock('../query/newParameterized');

function act(c) {
	c.expected = {};
	c.textToAppend = 'textToAppend';
	newParameterized.expect(c.text + c.textToAppend, [c.param1, c.param2]).return(c.expected);
	c.returned = c.returned.append(c.textToAppend);
}

act.base = '../new';
module.exports = act;
github alfateam / rdb / table / query / newParameterizedSpec / req / new / prepend_text.js View on Github external
var requireMock = require('a').requireMock;
var newParameterized = requireMock('../query/newParameterized');

function act(c) {
	c.expected = {};
	c.textToPrepend = 'textToPrepend';
	newParameterized.expect(c.textToPrepend + c.text, [c.param1, c.param2]).return(c.expected);
	c.returned = c.returned.prepend(c.textToPrepend);
}

act.base = '../new';
module.exports = act;
github alfateam / rdb / table / readStream / pg / newQueryCoreSpec / new.js View on Github external
var requireMock = require('a').requireMock;
var mock = require('a').mock;
var newSingleQuery = requireMock('./query/newSingleQuery');
var newSubQueries = requireMock('./query/newSubQueries');
var extractFilter = requireMock('../../query/extractFilter');
var extractOrderBy = requireMock('../extractOrderBy');
var extractLimit = requireMock('../extractLimit');
var newParameterized = requireMock('../../query/newParameterized');
var table = {};
var filter = {};
var initialFilter = {};
var orderBy = {};
var singleQuery = {};
var subQueries = {};
var limit = {};

var span = {};
var alias = '_2;'
var expected = {};

function act(c) {
	extractFilter.expect(initialFilter).return(filter);
	extractOrderBy.expect(alias, span).return(orderBy);
	extractLimit.expect(span).return(limit);
github alfateam / rdb / table / query / newParameterizedSpec / req / new / prepend_parameterized.js View on Github external
var requireMock = require('a').requireMock;
var mock = require('a').mock;
var newParameterized = requireMock('../query/newParameterized');
var parameterizedToPrepend = {};
var param3 = {};
var param4 = {};

function act(c) {
	c.expected = {};
	parameterizedToPrepend.sql = mock();
	parameterizedToPrepend.sql.expect().return('textToPrepend');	
	parameterizedToPrepend.parameters = [param3, param4];
	newParameterized.expect('textToPrepend' + c.text, [param3, param4, c.param1, c.param2]).return(c.expected);
	c.returned = c.returned.prepend(parameterizedToPrepend);
}

act.base = '../new';
module.exports = act;
github alfateam / rdb / table / query / newParameterizedSpec / req / new / append_parameterized.js View on Github external
var requireMock = require('a').requireMock;
var mock = require('a').mock;
var newParameterized = requireMock('../query/newParameterized');
var parameterizedToAppend = {};
var param3 = {};
var param4 = {};
var textToAppend = 'textToAppend';

function act(c) {	
	c.expected = {};
	parameterizedToAppend.sql = mock();
	parameterizedToAppend.sql.expect().return(textToAppend);	

	parameterizedToAppend.parameters = [param3, param4];
	newParameterized.expect(c.text + textToAppend , [c.param1, c.param2, param3, param4]).return(c.expected);
	c.returned = c.returned.append(parameterizedToAppend);
}

act.base = '../new';

a

Mocking framework

MIT
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis

Popular a functions