mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-15 13:17:50 +00:00
Add map and set guards to tests to fix travis runs.
This commit is contained in:
30
test/test.js
30
test/test.js
@@ -7416,6 +7416,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should partial match maps', 3, function() {
|
test('should partial match maps', 3, function() {
|
||||||
|
if (Map) {
|
||||||
var objects = [{ 'a': new Map }, { 'a': new Map }];
|
var objects = [{ 'a': new Map }, { 'a': new Map }];
|
||||||
objects[0].a.set('a', 1);
|
objects[0].a.set('a', 1);
|
||||||
objects[1].a.set('a', 1);
|
objects[1].a.set('a', 1);
|
||||||
@@ -7441,9 +7442,14 @@
|
|||||||
actual = _.filter(objects, predicate);
|
actual = _.filter(objects, predicate);
|
||||||
|
|
||||||
deepEqual(actual, []);
|
deepEqual(actual, []);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
skipTest(3);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should partial match sets', 3, function() {
|
test('should partial match sets', 3, function() {
|
||||||
|
if (Set) {
|
||||||
var objects = [{ 'a': new Set }, { 'a': new Set }];
|
var objects = [{ 'a': new Set }, { 'a': new Set }];
|
||||||
objects[0].a.add(1);
|
objects[0].a.add(1);
|
||||||
objects[1].a.add(1);
|
objects[1].a.add(1);
|
||||||
@@ -7469,6 +7475,10 @@
|
|||||||
actual = _.filter(objects, predicate);
|
actual = _.filter(objects, predicate);
|
||||||
|
|
||||||
deepEqual(actual, []);
|
deepEqual(actual, []);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
skipTest(3);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should match properties when `object` is not a plain object', 1, function() {
|
test('should match properties when `object` is not a plain object', 1, function() {
|
||||||
@@ -9636,6 +9646,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should partial match maps', 3, function() {
|
test('should partial match maps', 3, function() {
|
||||||
|
if (Map) {
|
||||||
var objects = [{ 'a': new Map }, { 'a': new Map }];
|
var objects = [{ 'a': new Map }, { 'a': new Map }];
|
||||||
objects[0].a.set('a', 1);
|
objects[0].a.set('a', 1);
|
||||||
objects[1].a.set('a', 1);
|
objects[1].a.set('a', 1);
|
||||||
@@ -9656,9 +9667,14 @@
|
|||||||
actual = _.filter(objects, _.matches({ 'a': map }));
|
actual = _.filter(objects, _.matches({ 'a': map }));
|
||||||
|
|
||||||
deepEqual(actual, []);
|
deepEqual(actual, []);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
skipTest(3);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should partial match sets', 3, function() {
|
test('should partial match sets', 3, function() {
|
||||||
|
if (Set) {
|
||||||
var objects = [{ 'a': new Set }, { 'a': new Set }];
|
var objects = [{ 'a': new Set }, { 'a': new Set }];
|
||||||
objects[0].a.add(1);
|
objects[0].a.add(1);
|
||||||
objects[1].a.add(1);
|
objects[1].a.add(1);
|
||||||
@@ -9679,6 +9695,10 @@
|
|||||||
actual = _.filter(objects, _.matches({ 'a': set }));
|
actual = _.filter(objects, _.matches({ 'a': set }));
|
||||||
|
|
||||||
deepEqual(actual, []);
|
deepEqual(actual, []);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
skipTest(3);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should match properties when `object` is not a plain object', 1, function() {
|
test('should match properties when `object` is not a plain object', 1, function() {
|
||||||
@@ -9998,6 +10018,7 @@
|
|||||||
deepEqual(actual, [objects[0]]);
|
deepEqual(actual, [objects[0]]);
|
||||||
});
|
});
|
||||||
test('should partial match maps', 3, function() {
|
test('should partial match maps', 3, function() {
|
||||||
|
if (Map) {
|
||||||
var objects = [{ 'a': new Map }, { 'a': new Map }];
|
var objects = [{ 'a': new Map }, { 'a': new Map }];
|
||||||
objects[0].a.set('a', 1);
|
objects[0].a.set('a', 1);
|
||||||
objects[1].a.set('a', 1);
|
objects[1].a.set('a', 1);
|
||||||
@@ -10018,9 +10039,14 @@
|
|||||||
actual = _.filter(objects, _.matchesProperty('a', map));
|
actual = _.filter(objects, _.matchesProperty('a', map));
|
||||||
|
|
||||||
deepEqual(actual, []);
|
deepEqual(actual, []);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
skipTest(3);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should partial match sets', 3, function() {
|
test('should partial match sets', 3, function() {
|
||||||
|
if (Set) {
|
||||||
var objects = [{ 'a': new Set }, { 'a': new Set }];
|
var objects = [{ 'a': new Set }, { 'a': new Set }];
|
||||||
objects[0].a.add(1);
|
objects[0].a.add(1);
|
||||||
objects[1].a.add(1);
|
objects[1].a.add(1);
|
||||||
@@ -10041,6 +10067,10 @@
|
|||||||
actual = _.filter(objects, _.matchesProperty('a', set));
|
actual = _.filter(objects, _.matchesProperty('a', set));
|
||||||
|
|
||||||
deepEqual(actual, []);
|
deepEqual(actual, []);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
skipTest(3);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should match properties when `srcValue` is not a plain object', 1, function() {
|
test('should match properties when `srcValue` is not a plain object', 1, function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user