Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import { mount, configure } from 'enzyme';
- import Adapter from 'enzyme-adapter-react-16';
- configure({ adapter: new Adapter() });
- // tslint:disable-next-line:ban-types
- type CallbackFunction = Function;
- export interface TestHookProps {
- callback: CallbackFunction;
- }
- const TestHook = ({ callback }: TestHookProps): null => {
- callback();
- return null;
- };
- export const testHook = (callback: CallbackFunction): void => {
- mount(<TestHook callback={callback} />);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement