Add haveSameContents snippet
This commit is contained in:
17
test/haveSameContents.test.js
Normal file
17
test/haveSameContents.test.js
Normal file
@ -0,0 +1,17 @@
|
||||
const {haveSameContents} = require('./_30s.js');
|
||||
|
||||
test('haveSameContents is a Function', () => {
|
||||
expect(haveSameContents).toBeInstanceOf(Function);
|
||||
});
|
||||
test('returns true for arrays with same contents', () => {
|
||||
expect(haveSameContents([1, 2, 3], [2, 3, 1])).toBeTruthy();
|
||||
});
|
||||
test('returns false for arrays with different contents', () => {
|
||||
expect(haveSameContents([1, 2], [2, 3, 1])).toBeFalsy();
|
||||
});
|
||||
test('returns false for arrays with different contents', () => {
|
||||
expect(haveSameContents([1, 2, 3], [2, 1])).toBeFalsy();
|
||||
});
|
||||
test('returns false for arrays with different contents', () => {
|
||||
expect(haveSameContents([1, 2, 3], [2, 1, 6])).toBeFalsy();
|
||||
});
|
||||
Reference in New Issue
Block a user