-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle null and undefined prop values
fixes #1
- Loading branch information
vvo
committed
Oct 16, 2015
1 parent
7060f39
commit 9a57a10
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,11 +152,27 @@ describe(`reactElementToJSXString(ReactElement)`, () => { | |
}).toThrow('react-element-to-jsx-string: Expected a ReactElement'); | ||
}); | ||
|
||
it('ignores object keys order (sortobject)', () => { | ||
it(`ignores object keys order (sortobject)`, () => { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
vvo
Contributor
|
||
expect( | ||
reactElementToJSXString(<div o={{a: 1, b: 2}}/>) | ||
).toEqual( | ||
reactElementToJSXString(<div o={{b: 2, a: 1}}/>) | ||
); | ||
}); | ||
|
||
it(`reactElementToJSXString(<div a={null} />`, () => { | ||
expect( | ||
reactElementToJSXString(<div a={null} />) | ||
).toEqual( | ||
reactElementToJSXString(<div a={null} />) | ||
); | ||
}); | ||
|
||
it(`reactElementToJSXString(<div a={undefined} />`, () => { | ||
expect( | ||
reactElementToJSXString(<div a={undefined} />) | ||
).toEqual( | ||
reactElementToJSXString(<div a={undefined} />) | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why backquotes?