mirror of
https://github.com/streamich/react-use.git
synced 2026-01-18 14:06:52 +00:00
Test for 'set' callback also
This commit is contained in:
parent
d1f3afbabd
commit
9e48050de4
@ -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);
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user