Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import React from 'react';
  2. import { mount, configure } from 'enzyme';
  3. import Adapter from 'enzyme-adapter-react-16';
  4.  
  5. configure({ adapter: new Adapter() });
  6.  
  7. // tslint:disable-next-line:ban-types
  8. type CallbackFunction = Function;
  9.  
  10. export interface TestHookProps {
  11. callback: CallbackFunction;
  12. }
  13.  
  14. const TestHook = ({ callback }: TestHookProps): null => {
  15. callback();
  16. return null;
  17. };
  18.  
  19. export const testHook = (callback: CallbackFunction): void => {
  20. mount(<TestHook callback={callback} />);
  21. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement