Skip to content

Commit

Permalink
Add tests for setting text and html as non-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Rycochet committed Apr 22, 2015
1 parent a0ff74c commit 2dc84d5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/cheerio.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,18 @@ describe('cheerio', function() {
expect($empty.each).to.be($.prototype.each);
});

it('should set html(number) as a string', function() {
var $elem = $('<div>');
$elem.html(123);
expect(typeof $elem.text()).to.equal('string');
});

it('should set text(number) as a string', function() {
var $elem = $('<div>');
$elem.text(123);
expect(typeof $elem.text()).to.equal('string');
});

describe('.load', function() {

it('should generate selections as proper instances', function() {
Expand Down

0 comments on commit 2dc84d5

Please sign in to comment.