Test for 'set' callback also

This commit is contained in:
Brendan Daoud 2019-09-05 15:36:35 +02:00
parent d1f3afbabd
commit 9e48050de4

View File

@ -110,10 +110,12 @@ it('should reset map to initial object provided', () => {
it('should memoized its utils methods', () => {
const { result } = setUp({ foo: 'bar', a: 1 });
const [, utils] = result.current;
const { set } = utils;
act(() => {
utils.set('foo', 'baz');
set('foo', 'baz');
});
expect(result.current[1]).toBe(utils);
expect(result.current[1].set).toBe(set);
});