import checkCondition from './checkCondition'; describe('checkCondition)', () => { const childItem = { a: 'foo', b: true, c: 30, }; const emptyChildItem = { }; it('should return true', () => { expect(checkCondition( childItem, [ ['a', '!=', 'bar'], ['a', '==', 'foo'], ['b', '!=', false], ['b', '==', true], ['c', '==', 30], ['c', '!=', 0], ['c', '>=', 30], ['c', '>', 29] ] )).toBe(true); }); it('should return false', () => { expect(checkCondition( emptyChildItem, [['a', '==', 'foo']] )).toBe(false); }); it('should return false', () => { expect(checkCondition(undefined, [['a', '==', 'foo']])).toBe(false); }); });