Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('allows to cancel delegated dependencies by exactKey=true option', () => {
const obj = {
'a.b.c': 1,
'd.e.f': 2
};
calc(obj, 'c', ['a.b.c', 'd.e.f'], (abc, def) => abc + def, {
debounceCalc: false,
exactKey: true
});
expect(obj.c).toEqual(3);
obj['a.b.c'] = 3;
expect(obj.c).toEqual(5);
obj['d.e.f'] = 3;
expect(obj.c).toEqual(6);
});
it('allows to cancel delegated dependencies by exactKey=true option', () => {
const obj = {
'a.b.c': 1,
'd.e.f': 2
};
calc(obj, 'c', ['a.b.c', 'd.e.f'], (abc, def) => abc + def, {
debounceCalc: false,
exactKey: true
});
expect(obj.c).toEqual(3);
obj['a.b.c'] = 3;
expect(obj.c).toEqual(5);
obj['d.e.f'] = 3;
expect(obj.c).toEqual(6);
});