json-based-conditions-and-rules-logic-evaluator
Version:
script that parses some customizable conditions and rules, then outputs a predefined value of that matching rule, or a default value
15 lines (13 loc) • 486 B
JavaScript
const assert = require('assert');
const { isEndedWith } = require('./index');
describe('Conditions Method isEndedWith', () => {
it('returns true when lhs is ABCD and rhs is D', () => {
assert.equal(isEndedWith('ABCD', 'D'), true);
});
it('returns true when lhs is ABCD and rhs is ABCD', () => {
assert.equal(isEndedWith('ABCD', 'ABCD'), true);
});
it('returns false when lhs is ABCD and rhs is C', () => {
assert.equal(isEndedWith('ABCD', 'C'), false);
});
});