From 9b48bd27ddfae4abd224ad5cbfada6e5293a4e0b Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 21 Dec 2014 18:10:06 -0600 Subject: [PATCH] Ajust tests for npm build modifications. --- test/test.js | 53 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/test/test.js b/test/test.js index 13195e401..d82f65bf6 100644 --- a/test/test.js +++ b/test/test.js @@ -788,24 +788,34 @@ expected = _.map(values, _.constant(true)); test('creates a new instance when called without the `new` operator', 1, function() { - var actual = _.map(values, function(value) { - return _(value) instanceof _; - }); + if (!isNpm) { + var actual = _.map(values, function(value) { + return _(value) instanceof _; + }); - deepEqual(actual, expected); + deepEqual(actual, expected); + } + else { + skipTest(); + } }); test('should return provided `lodash` instances', 1, function() { - var actual = _.map(values, function(value) { - var wrapped = _(value); - return _(wrapped) === wrapped; - }); + if (!isNpm) { + var actual = _.map(values, function(value) { + var wrapped = _(value); + return _(wrapped) === wrapped; + }); - deepEqual(actual, expected); + deepEqual(actual, expected); + } + else { + skipTest(); + } }); test('should convert foreign wrapped values to `lodash` instances', 1, function() { - if (lodashBizarro) { + if (!isNpm && lodashBizarro) { var actual = _.map(values, function(value) { var wrapped = _(lodashBizarro(value)), unwrapped = getUnwrappedValue(wrapped); @@ -8651,19 +8661,24 @@ source = { 'a': function(array) { return array[0]; }, 'b': 'B' }; test('should mixin `source` methods into lodash', 4, function() { - _.mixin(source); + if (!isNpm) { + _.mixin(source); - strictEqual(_.a(value), 'a'); - strictEqual(getUnwrappedValue(_(value).a()), 'a'); + strictEqual(_.a(value), 'a'); + strictEqual(getUnwrappedValue(_(value).a()), 'a'); - delete _.a; - delete _.prototype.a; + delete _.a; + delete _.prototype.a; - ok(!('b' in _)); - ok(!('b' in _.prototype)); + ok(!('b' in _)); + ok(!('b' in _.prototype)); - delete _.b; - delete _.prototype.b; + delete _.b; + delete _.prototype.b; + } + else { + skipTest(4); + } }); test('should use `this` as the default `object` value', 3, function() {