We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9248988 commit 3cbc8e5Copy full SHA for 3cbc8e5
1 file changed
test/jqLiteSpec.js
@@ -881,6 +881,12 @@ describe('jqLite', function() {
881
expect(element.text('xyz') == element).toBeTruthy();
882
expect(element.text()).toEqual('xyzxyz');
883
});
884
+
885
+ it('should return text only for element or text nodes', function() {
886
+ expect(jqLite('<div>foo</div>').text()).toBe('foo');
887
+ expect(jqLite('<div>foo</div>').contents().eq(0).text()).toBe('foo');
888
+ expect(jqLite(document.createComment('foo')).text()).toBe('');
889
+ });
890
891
892
0 commit comments