We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3054368 commit ab544bdCopy full SHA for ab544bd
src/testHook.js
@@ -0,0 +1,14 @@
1
+import React from 'react';
2
+import { shallow } from 'enzyme';
3
+
4
+function testHook(hook) {
5
+ let output;
6
+ function HookWrapper() {
7
+ output = hook();
8
+ return <></>;
9
+ }
10
+ shallow(<HookWrapper />);
11
+ return output;
12
+}
13
14
+export default testHook;
src/useModalManagement.test.js
@@ -1,7 +1,8 @@
import useModalManagement from './useModalManagement';
+import testHook from './testHook';
describe('The useModalManagement hook', () => {
it('should not throw an error', () => {
- useModalManagement();
+ testHook(useModalManagement);
});
0 commit comments