Add isContained

This commit is contained in:
Angelos Chalaris
2020-01-05 21:40:51 +02:00
parent 9a3e74cefa
commit ec5509f7de
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,17 @@
const {isContainedIn} = require('./_30s.js');
test('isContainedIn is a Function', () => {
expect(isContainedIn).toBeInstanceOf(Function);
});
test('returns true for arrays with same contents', () => {
expect(isContainedIn([1, 2, 3], [2, 3, 1])).toBeTruthy();
});
test('returns true for arrays with correct contents', () => {
expect(isContainedIn([1, 2], [2, 3, 1])).toBeTruthy();
});
test('returns false for arrays with different contents', () => {
expect(isContainedIn([1, 4], [2, 3, 1])).toBeFalsy();
});
test('returns false for arrays with different contents', () => {
expect(isContainedIn([1, 2, 3], [2, 1, 6])).toBeFalsy();
});