add includesAll

This commit is contained in:
7assentlili
2019-11-04 20:37:16 +01:00
parent 126a73e3b9
commit c221478e2d
2 changed files with 31 additions and 0 deletions

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

@ -0,0 +1,14 @@
const {includesAll} = require('./_30s.js');
test('any is a Function', () => {
expect(includesAll).toBeInstanceOf(Function);
});
test('Returns true when all values are included in arr', () => {
expect(includesAll([0, 1, 2, 3], [0, 1])).toBe(true);
});
test('Returns false when one element fo values is not included in arr', () => {
expect(includesAll([0, 1, 2, 3], [1, 2, 4])).toBe(false);
});
test('Returns false when values is larger than arr', () => {
expect(includesAll([0, 1, 2], [0, 1, 2, 3])).toBe(false);
});