Skip to content

Commit 3289e2b

Browse files
committed
add correct test to expected thrown error
Signed-off-by: Winner95 <Winner95@users.noreply.github.com>
1 parent a057550 commit 3289e2b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

__tests__/handler.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ describe('typescript-react-function-component-props-handler', () => {
3939
expect(doc.displayName).toBe('TooltipTarget');
4040
});
4141

42-
// Currently return error
43-
// test('handles React.forwardRef(...) components - part 2', () => {
44-
// const doc = parseFixture('ForwardedButton.tsx');
45-
// console.log(doc)
46-
// expect(doc.displayName).toBe('Button');
47-
// });
42+
// Currently returns error for React.forwardRef(...) components
43+
test('handles React.forwardRef(...) components - part 2', () => {
44+
expect(() => parseFixture('ForwardedButton.tsx')).toThrow(
45+
"Cannot read properties of undefined (reading 'length')"
46+
);
47+
});
4848

4949
// Line 31 in index.js without type - can't be tested directly because of early return
5050
test('handles components without type', () => {

0 commit comments

Comments
 (0)