Skip to content

Instantly share code, notes, and snippets.

View JohnMadakin's full-sized avatar
🏠
Working from home

Edafe JohnMadakin

🏠
Working from home
View GitHub Profile
import expect from 'expect';
import request from 'supertest';
import app from '../index';
describe('Test for Signup', () => {
it('should login users', (done) => {
const userDetail = {
username: 'christain5',
password: 'password@1',
@JohnMadakin
JohnMadakin / rulerunner.js
Last active November 23, 2020 14:50
rulerunner
module.exports = function schemmaRunner(dataObject, ruleSchema) {
console.log('+++++++ ', combineRuleSchema(dataObject, ruleSchema));
};
function combineRuleSchema(dataObject, ruleSchema) {
const result = [];
const ruleSet = ruleSchema.ruleSet;
if (ruleSet['and'] && ruleSet['and'].length) {
result.push(evaluateRuleSchema(ruleSet, dataObject, 'and'));
}