Skip to content

Commit fd0e183

Browse files
committed
Fix ReactHooksInspection-test.js
1 parent 447fc27 commit fd0e183

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

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

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -584,24 +584,29 @@ describe('ReactHooksInspection', () => {
584584
return <div>{value}</div>;
585585
}
586586
const tree = ReactDebugTools.inspectHooks(Foo, {});
587-
expect(normalizeSourceLoc(tree)).toMatchInlineSnapshot(`
588-
[
589-
{
590-
"debugInfo": null,
591-
"hookSource": {
592-
"columnNumber": 0,
593-
"fileName": "**",
594-
"functionName": "Foo",
595-
"lineNumber": 0,
596-
},
597-
"id": null,
598-
"isStateEditable": false,
599-
"name": "Unresolved",
600-
"subHooks": [],
601-
"value": Promise {},
587+
const results = normalizeSourceLoc(tree);
588+
expect(results).toHaveLength(1);
589+
expect(results[0]).toMatchInlineSnapshot(
590+
{
591+
value: expect.any(Promise),
592+
},
593+
`
594+
{
595+
"debugInfo": null,
596+
"hookSource": {
597+
"columnNumber": 0,
598+
"fileName": "**",
599+
"functionName": "Foo",
600+
"lineNumber": 0,
602601
},
603-
]
604-
`);
602+
"id": null,
603+
"isStateEditable": false,
604+
"name": "Unresolved",
605+
"subHooks": [],
606+
"value": Any<Promise>,
607+
}
608+
`,
609+
);
605610
});
606611

607612
describe('useDebugValue', () => {

0 commit comments

Comments
 (0)