Skip to content

Commit 76ecbe4

Browse files
committed
chore: adjust a test implementation to be more meaningful
1 parent cd28cbd commit 76ecbe4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/index.spec.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ describe('reactElementToJSXString(ReactElement)', () => {
13351335
expect(reactElementToJSXString(<Lazy />)).toEqual(`<Lazy />`);
13361336
});
13371337

1338-
it('should not crash when stringifying circular `forwardRef` element', () => {
1338+
it('should stringify `forwardRef` elenet with a circular property', () => {
13391339
function TagList({ tags }) {
13401340
return tags;
13411341
}
@@ -1345,10 +1345,14 @@ describe('reactElementToJSXString(ReactElement)', () => {
13451345
});
13461346
Tag.emotionReal = Tag;
13471347

1348-
expect(() =>
1348+
expect(
13491349
reactElementToJSXString(
13501350
<TagList tags={[<Tag key="oops" text="oops, circular" />]} />
13511351
)
1352-
).not.toThrow();
1352+
).toEqual(`<TagList
1353+
tags={[
1354+
<Tag key="oops" text="oops, circular"/>
1355+
]}
1356+
/>`);
13531357
});
13541358
});

0 commit comments

Comments
 (0)