Skip to content

Commit

Permalink
[Tests] add tests to ensure ±Infinity works.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Aug 28, 2016
1 parent f83c529 commit 0314e2f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/ShallowTraversal-spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ describe('ShallowTraversal', () => {
expect(nodeHasProperty(<div foo={0} />, 'foo', 'false')).to.equal(false);
});

it('should work with ±Infinity', () => {
expect(nodeHasProperty(<div foo={Infinity} />, 'foo', 'Infinity')).to.equal(true);
expect(nodeHasProperty(<div foo={0} />, 'foo', 'Infinity')).to.equal(false);
expect(nodeHasProperty(<div foo={-Infinity} />, 'foo', '-Infinity')).to.equal(true);
expect(nodeHasProperty(<div foo={0} />, 'foo', '-Infinity')).to.equal(false);
});

it('should throw when un unquoted string is passed in', () => {
const node = (<div title="foo" />);

Expand Down

0 comments on commit 0314e2f

Please sign in to comment.