Skip to content

Commit 3446694

Browse files
committed
add safer tests for other composite hooks
1 parent eff36c1 commit 3446694

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ describe('ReactHooksInspectionIntegration', () => {
546546
function Foo(props) {
547547
React.useTransition();
548548
const memoizedValue = React.useMemo(() => 'hello', []);
549+
React.useMemo(() => 'not used', []);
549550
return <div>{memoizedValue}</div>;
550551
}
551552
const renderer = ReactTestRenderer.create(<Foo />);
@@ -566,6 +567,13 @@ describe('ReactHooksInspectionIntegration', () => {
566567
value: 'hello',
567568
subHooks: [],
568569
},
570+
{
571+
id: 2,
572+
isStateEditable: false,
573+
name: 'Memo',
574+
value: 'not used',
575+
subHooks: [],
576+
},
569577
]);
570578
});
571579

@@ -1020,6 +1028,7 @@ describe('ReactHooksInspectionIntegration', () => {
10201028
() => {},
10211029
);
10221030
React.useMemo(() => 'memo', []);
1031+
React.useMemo(() => 'not used', []);
10231032
return <div />;
10241033
}
10251034
const renderer = ReactTestRenderer.create(<Foo />);
@@ -1040,6 +1049,13 @@ describe('ReactHooksInspectionIntegration', () => {
10401049
value: 'memo',
10411050
subHooks: [],
10421051
},
1052+
{
1053+
id: 2,
1054+
isStateEditable: false,
1055+
name: 'Memo',
1056+
value: 'not used',
1057+
subHooks: [],
1058+
},
10431059
]);
10441060
});
10451061

@@ -1051,6 +1067,7 @@ describe('ReactHooksInspectionIntegration', () => {
10511067
() => 'snapshot',
10521068
);
10531069
React.useMemo(() => 'memo', []);
1070+
React.useMemo(() => 'not used', []);
10541071
return value;
10551072
}
10561073

@@ -1072,6 +1089,13 @@ describe('ReactHooksInspectionIntegration', () => {
10721089
value: 'memo',
10731090
subHooks: [],
10741091
},
1092+
{
1093+
id: 2,
1094+
isStateEditable: false,
1095+
name: 'Memo',
1096+
value: 'not used',
1097+
subHooks: [],
1098+
},
10751099
]);
10761100
});
10771101
});

0 commit comments

Comments
 (0)