Skip to content

Instantly share code, notes, and snippets.

@niinpatel
Created February 25, 2019 16:08
Show Gist options
  • Save niinpatel/1830dc3afb2a40321b1cb2b01d98a17e to your computer and use it in GitHub Desktop.
Save niinpatel/1830dc3afb2a40321b1cb2b01d98a17e to your computer and use it in GitHub Desktop.
import useCustomEffect from '../useCustomEffect';
import testHook from '../testHook';
import sideEffect from 'sideeffect';
jest.mock('sideeffect')
describe('useCustomEffect', () => {
test('should call side effect', () => {
testHook(useCustomEffect);
expect(sideEffect).toHaveBeenCalledTimes(1);
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment