Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 3cbc8e5

Browse files
IgorMinarrodyhaddad
authored andcommitted
test(jqLite): add a missing test for jqLite#text
1 parent 9248988 commit 3cbc8e5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/jqLiteSpec.js

+6
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,12 @@ describe('jqLite', function() {
881881
expect(element.text('xyz') == element).toBeTruthy();
882882
expect(element.text()).toEqual('xyzxyz');
883883
});
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+
});
884890
});
885891

886892

0 commit comments

Comments
 (0)