mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Expose _.join.
This commit is contained in:
72
test/test.js
72
test/test.js
@@ -10657,6 +10657,44 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.join');
|
||||
|
||||
(function() {
|
||||
var array = ['a', 'b', 'c'];
|
||||
|
||||
QUnit.test('should return join all array elements into a string', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
assert.strictEqual(_.join(array, '~'), 'a~b~c');
|
||||
});
|
||||
|
||||
QUnit.test('should return an unwrapped value when implicitly chaining', function(assert) {
|
||||
assert.expect(2);
|
||||
|
||||
if (!isNpm) {
|
||||
var wrapped = _(array);
|
||||
assert.strictEqual(wrapped.join('~'), 'a~b~c');
|
||||
assert.strictEqual(wrapped.value(), array);
|
||||
}
|
||||
else {
|
||||
skipTest(assert, 2);
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.test('should return a wrapped value when explicitly chaining', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
if (!isNpm) {
|
||||
assert.ok(_(array).chain().join('~') instanceof _);
|
||||
}
|
||||
else {
|
||||
skipTest(assert);
|
||||
}
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.keyBy');
|
||||
|
||||
(function() {
|
||||
@@ -21533,38 +21571,6 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash(...).join');
|
||||
|
||||
(function() {
|
||||
var array = [1, 2, 3];
|
||||
|
||||
QUnit.test('should return join all array elements into a string', function(assert) {
|
||||
assert.expect(2);
|
||||
|
||||
if (!isNpm) {
|
||||
var wrapped = _(array);
|
||||
assert.strictEqual(wrapped.join('.'), '1.2.3');
|
||||
assert.strictEqual(wrapped.value(), array);
|
||||
}
|
||||
else {
|
||||
skipTest(assert, 2);
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.test('should return a wrapped value when explicitly chaining', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
if (!isNpm) {
|
||||
assert.ok(_(array).chain().join('.') instanceof _);
|
||||
}
|
||||
else {
|
||||
skipTest(assert);
|
||||
}
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash(...).next');
|
||||
|
||||
lodashStable.each([true, false], function(implict) {
|
||||
@@ -22528,7 +22534,7 @@
|
||||
var acceptFalsey = lodashStable.difference(allMethods, rejectFalsey);
|
||||
|
||||
QUnit.test('should accept falsey arguments', function(assert) {
|
||||
assert.expect(278);
|
||||
assert.expect(279);
|
||||
|
||||
var emptyArrays = lodashStable.map(falsey, lodashStable.constant([]));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user