8000 test: add test for size with string input by frontman-git · Pull Request #5996 · lodash/lodash · GitHub
[go: up one dir, main page]

Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20475,6 +20475,19 @@

assert.strictEqual(_.size({ 'length': '0' }), 1);
});

QUnit.test('should return string length for string values', function(assert) {
assert.expect(1);

assert.strictEqual(_.size('hi'), 2);
});

QUnit.test('should count unicode symbols as single units', function(assert) {
assert.expect(2);

assert.strictEqual(_.size('👨‍👩‍👧‍👦'), 1);
assert.strictEqual(_.size('👨\u200d👩\u200d👧\u200d👦'), 1);
});
}());

/*--------------------------------------------------------------------------*/
Expand Down
Loading
0