add includesAny

This commit is contained in:
7assentlili
2019-11-03 22:49:17 +01:00
parent aa8b71b0cc
commit 714e64d2b8
2 changed files with 31 additions and 0 deletions

14
test/includesAny.test.js Normal file
View File

@ -0,0 +1,14 @@
const {includesAny} = require('./_30s.js');
test('any is a Function', () => {
expect(includesAny).toBeInstanceOf(Function);
});
test('Returns true when values contains one element of arr', () => {
expect(includesAny([0, 1, 2, 3], [1, 10, 20])).toBe(true);
});
test('Returns false when values contains none of arr elements', () => {
expect(includesAny([0, 1, 2, 3], [10, 20, 30])).toBe(false);
});
test('Returns false when values is an empty array', () => {
expect(includesAny([0, 1, 2, 3], [])).toBe(false);
});