Skip to content

Commit

Permalink
Fix ReactHooksInspection-test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
yungsters committed Mar 7, 2024
1 parent 447fc27 commit fd0e183
Showing 1 changed file with 22 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -584,24 +584,29 @@ describe('ReactHooksInspection', () => {
return <div>{value}</div>;
}
const tree = ReactDebugTools.inspectHooks(Foo, {});
expect(normalizeSourceLoc(tree)).toMatchInlineSnapshot(`
[
{
"debugInfo": null,
"hookSource": {
"columnNumber": 0,
"fileName": "**",
"functionName": "Foo",
"lineNumber": 0,
},
"id": null,
"isStateEditable": false,
"name": "Unresolved",
"subHooks": [],
"value": Promise {},
const results = normalizeSourceLoc(tree);
expect(results).toHaveLength(1);
expect(results[0]).toMatchInlineSnapshot(
{
value: expect.any(Promise),
},
`
{
"debugInfo": null,
"hookSource": {
"columnNumber": 0,
"fileName": "**",
"functionName": "Foo",
"lineNumber": 0,
},
]
`);
"id": null,
"isStateEditable": false,
"name": "Unresolved",
"subHooks": [],
"value": Any<Promise>,
}
`,
);
});

describe('useDebugValue', () => {
Expand Down

0 comments on commit fd0e183

Please sign in to comment.