mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
Use var wrapped for wrapped values instead of actual.
This commit is contained in:
116
test/test.js
116
test/test.js
@@ -1782,9 +1782,9 @@
|
|||||||
|
|
||||||
test('should return a wrapped value when chaining', 2, function() {
|
test('should return a wrapped value when chaining', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(falsey).compact();
|
var wrapped = _(falsey).compact();
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
deepEqual(actual.value(), []);
|
deepEqual(wrapped.value(), []);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
@@ -1845,8 +1845,8 @@
|
|||||||
|
|
||||||
test('`_.' + methodName + '` should return a wrapped value when chaining', 1, function() {
|
test('`_.' + methodName + '` should return a wrapped value when chaining', 1, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(_.noop)[methodName]();
|
var wrapped = _(_.noop)[methodName]();
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest();
|
skipTest();
|
||||||
@@ -1894,8 +1894,8 @@
|
|||||||
|
|
||||||
test('should return a wrapped value when chaining', 1, function() {
|
test('should return a wrapped value when chaining', 1, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(true).constant();
|
var wrapped = _(true).constant();
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest();
|
skipTest();
|
||||||
@@ -3019,9 +3019,9 @@
|
|||||||
|
|
||||||
test('should return a wrapped value when chaining', 2, function() {
|
test('should return a wrapped value when chaining', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(array).drop(2);
|
var wrapped = _(array).drop(2);
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
deepEqual(actual.value(), [3]);
|
deepEqual(wrapped.value(), [3]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
@@ -3073,9 +3073,9 @@
|
|||||||
|
|
||||||
test('should return a wrapped value when chaining', 2, function() {
|
test('should return a wrapped value when chaining', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(array).dropRight(2);
|
var wrapped = _(array).dropRight(2);
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
deepEqual(actual.value(), [1]);
|
deepEqual(wrapped.value(), [1]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
@@ -3132,12 +3132,12 @@
|
|||||||
|
|
||||||
test('should return a wrapped value when chaining', 2, function() {
|
test('should return a wrapped value when chaining', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(array).dropRightWhile(function(num) {
|
var wrapped = _(array).dropRightWhile(function(num) {
|
||||||
return num > 1;
|
return num > 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
deepEqual(actual.value(), [1]);
|
deepEqual(wrapped.value(), [1]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
@@ -3194,12 +3194,12 @@
|
|||||||
|
|
||||||
test('should return a wrapped value when chaining', 2, function() {
|
test('should return a wrapped value when chaining', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(array).dropWhile(function(num) {
|
var wrapped = _(array).dropWhile(function(num) {
|
||||||
return num < 3;
|
return num < 3;
|
||||||
});
|
});
|
||||||
|
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
deepEqual(actual.value(), [3]);
|
deepEqual(wrapped.value(), [3]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
@@ -3636,9 +3636,9 @@
|
|||||||
|
|
||||||
test('should return a wrapped value when chaining', 2, function() {
|
test('should return a wrapped value when chaining', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(array).take(2);
|
var wrapped = _(array).take(2);
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
deepEqual(actual.value(), [1, 2]);
|
deepEqual(wrapped.value(), [1, 2]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
@@ -3690,9 +3690,9 @@
|
|||||||
|
|
||||||
test('should return a wrapped value when chaining', 2, function() {
|
test('should return a wrapped value when chaining', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(array).takeRight(2);
|
var wrapped = _(array).takeRight(2);
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
deepEqual(actual.value(), [2, 3]);
|
deepEqual(wrapped.value(), [2, 3]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
@@ -3749,12 +3749,12 @@
|
|||||||
|
|
||||||
test('should return a wrapped value when chaining', 2, function() {
|
test('should return a wrapped value when chaining', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(array).takeRightWhile(function(num) {
|
var wrapped = _(array).takeRightWhile(function(num) {
|
||||||
return num > 1;
|
return num > 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
deepEqual(actual.value(), [2, 3]);
|
deepEqual(wrapped.value(), [2, 3]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
@@ -3811,12 +3811,12 @@
|
|||||||
|
|
||||||
test('should return a wrapped value when chaining', 2, function() {
|
test('should return a wrapped value when chaining', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(array).takeWhile(function(num) {
|
var wrapped = _(array).takeWhile(function(num) {
|
||||||
return num < 3;
|
return num < 3;
|
||||||
});
|
});
|
||||||
|
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
deepEqual(actual.value(), [1, 2]);
|
deepEqual(wrapped.value(), [1, 2]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
@@ -4146,8 +4146,8 @@
|
|||||||
|
|
||||||
test('`_.' + methodName + '` should return a wrapped value when chaining', 1, function() {
|
test('`_.' + methodName + '` should return a wrapped value when chaining', 1, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(array)[methodName](_.noop);
|
var wrapped = _(array)[methodName](_.noop);
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest();
|
skipTest();
|
||||||
@@ -4161,8 +4161,8 @@
|
|||||||
|
|
||||||
test('`_.' + methodName + '` should return an unwrapped value when chaining', 1, function() {
|
test('`_.' + methodName + '` should return an unwrapped value when chaining', 1, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(array)[methodName](_.noop);
|
var wrapped = _(array)[methodName](_.noop);
|
||||||
ok(!(actual instanceof _));
|
ok(!(wrapped instanceof _));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest();
|
skipTest();
|
||||||
@@ -4874,9 +4874,9 @@
|
|||||||
|
|
||||||
test('should return a wrapped value when chaining', 2, function() {
|
test('should return a wrapped value when chaining', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(array).initial();
|
var wrapped = _(array).initial();
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
deepEqual(actual.value(), [1, 2]);
|
deepEqual(wrapped.value(), [1, 2]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
@@ -4935,9 +4935,9 @@
|
|||||||
|
|
||||||
test('should return a wrapped value when chaining', 2, function() {
|
test('should return a wrapped value when chaining', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _([1, 3, 2]).intersection([5, 2, 1, 4]);
|
var wrapped = _([1, 3, 2]).intersection([5, 2, 1, 4]);
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
deepEqual(actual.value(), [1, 2]);
|
deepEqual(wrapped.value(), [1, 2]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
@@ -4977,10 +4977,10 @@
|
|||||||
test('should return a wrapped value when chaining', 2, function() {
|
test('should return a wrapped value when chaining', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var object = { 'a': 1, 'b': 2 },
|
var object = { 'a': 1, 'b': 2 },
|
||||||
actual = _(object).invert();
|
wrapped = _(object).invert();
|
||||||
|
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
deepEqual(actual.value(), { '1': 'a', '2': 'b' });
|
deepEqual(wrapped.value(), { '1': 'a', '2': 'b' });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
@@ -9445,9 +9445,9 @@
|
|||||||
|
|
||||||
test('should return a wrapped value when chaining', 2, function() {
|
test('should return a wrapped value when chaining', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(array).rest();
|
var wrapped = _(array).rest();
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
deepEqual(actual.value(), [2, 3]);
|
deepEqual(wrapped.value(), [2, 3]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
@@ -10216,14 +10216,14 @@
|
|||||||
var intercepted,
|
var intercepted,
|
||||||
array = [1, 2, 3];
|
array = [1, 2, 3];
|
||||||
|
|
||||||
var actual = _(array).tap(function(value) {
|
var wrapped = _(array).tap(function(value) {
|
||||||
intercepted = value;
|
intercepted = value;
|
||||||
value.pop();
|
value.pop();
|
||||||
});
|
});
|
||||||
|
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
|
|
||||||
actual.value();
|
wrapped.value();
|
||||||
strictEqual(intercepted, array);
|
strictEqual(intercepted, array);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -10235,11 +10235,11 @@
|
|||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var array = [1, 2];
|
var array = [1, 2];
|
||||||
|
|
||||||
var actual = _(array.slice()).tap(function(value) {
|
var wrapped = _(array.slice()).tap(function(value) {
|
||||||
value.push(this[0]);
|
value.push(this[0]);
|
||||||
}, array);
|
}, array);
|
||||||
|
|
||||||
deepEqual(actual.value(), [1, 2, 1]);
|
deepEqual(wrapped.value(), [1, 2, 1]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest();
|
skipTest();
|
||||||
@@ -11124,9 +11124,9 @@
|
|||||||
|
|
||||||
test('should return a wrapped value when chaining', 2, function() {
|
test('should return a wrapped value when chaining', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _(3).times();
|
var wrapped = _(3).times();
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
deepEqual(actual.value(), [0, 1, 2]);
|
deepEqual(wrapped.value(), [0, 1, 2]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
@@ -11654,9 +11654,9 @@
|
|||||||
|
|
||||||
test('should return a wrapped value when chaining', 2, function() {
|
test('should return a wrapped value when chaining', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var actual = _([1, 2, 3]).xor([5, 2, 1, 4]);
|
var wrapped = _([1, 2, 3]).xor([5, 2, 1, 4]);
|
||||||
ok(actual instanceof _);
|
ok(wrapped instanceof _);
|
||||||
deepEqual(actual.value(), [3, 5, 4]);
|
deepEqual(wrapped.value(), [3, 5, 4]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
|
|||||||
Reference in New Issue
Block a user