From f6bf8d2e6d89d4e8c883f0e8a0a406435a961525 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 19 Apr 2016 12:38:00 -0700 Subject: [PATCH] Cleanup `-0` tests. --- test/test.js | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/test/test.js b/test/test.js index 275d67458..94cbf7a40 100644 --- a/test/test.js +++ b/test/test.js @@ -17473,15 +17473,14 @@ assert.expect(1); var object = { '-0': 'a', '0': 'b' }, - props = [-0, Object(-0), 0, Object(0)], - expected = ['a', 'a', 'b', 'b']; + props = [-0, Object(-0), 0, Object(0)]; var actual = lodashStable.map(props, function(key) { var prop = _.property(key); return prop(object); }); - assert.deepEqual(actual, expected); + assert.deepEqual(actual, ['a', 'a', 'b', 'b']); }); QUnit.test('should coerce key to a string', function(assert) { @@ -17490,8 +17489,7 @@ function fn() {} fn.toString = lodashStable.constant('fn'); - var expected = [1, 1, 2, 2, 3, 3, 4, 4], - objects = [{ 'null': 1 }, { 'undefined': 2 }, { 'fn': 3 }, { '[object Object]': 4 }], + var objects = [{ 'null': 1 }, { 'undefined': 2 }, { 'fn': 3 }, { '[object Object]': 4 }], values = [null, undefined, fn, {}]; var actual = lodashStable.transform(objects, function(result, object, index) { @@ -17502,7 +17500,7 @@ }); }); - assert.deepEqual(actual, expected); + assert.deepEqual(actual, [1, 1, 2, 2, 3, 3, 4, 4]); }); QUnit.test('should pluck a key over a path', function(assert) { @@ -17620,15 +17618,14 @@ assert.expect(1); var object = { '-0': 'a', '0': 'b' }, - props = [-0, Object(-0), 0, Object(0)], - expected = ['a', 'a', 'b', 'b']; + props = [-0, Object(-0), 0, Object(0)]; var actual = lodashStable.map(props, function(key) { var propOf = _.propertyOf(object); return propOf(key); }); - assert.deepEqual(actual, expected); + assert.deepEqual(actual, ['a', 'a', 'b', 'b']); }); QUnit.test('should coerce key to a string', function(assert) { @@ -17637,8 +17634,7 @@ function fn() {} fn.toString = lodashStable.constant('fn'); - var expected = [1, 1, 2, 2, 3, 3, 4, 4], - objects = [{ 'null': 1 }, { 'undefined': 2 }, { 'fn': 3 }, { '[object Object]': 4 }], + var objects = [{ 'null': 1 }, { 'undefined': 2 }, { 'fn': 3 }, { '[object Object]': 4 }], values = [null, undefined, fn, {}]; var actual = lodashStable.transform(objects, function(result, object, index) { @@ -17649,7 +17645,7 @@ }); }); - assert.deepEqual(actual, expected); + assert.deepEqual(actual, [1, 1, 2, 2, 3, 3, 4, 4]); }); QUnit.test('should pluck a key over a path', function(assert) { @@ -18842,14 +18838,13 @@ assert.expect(1); var object = { '-0': 'a', '0': 'b' }, - props = [-0, Object(-0), 0, Object(0)], - expected = ['a', 'a', 'b', 'b']; + props = [-0, Object(-0), 0, Object(0)]; var actual = lodashStable.map(props, function(key) { return func(object, key); }); - assert.deepEqual(actual, expected); + assert.deepEqual(actual, ['a', 'a', 'b', 'b']); }); QUnit.test('`_.' + methodName + '` should get symbol keyed property values', function(assert) {