Test cleanup and fixes [c-d]

This commit is contained in:
Angelos Chalaris
2018-06-18 16:34:04 +03:00
parent d29974ebc9
commit 105185c213
136 changed files with 805 additions and 484 deletions

View File

@ -5,6 +5,10 @@ const sortedIndex = require('./sortedIndex.js');
test('sortedIndex is a Function', () => {
expect(sortedIndex).toBeInstanceOf(Function);
});
t.equal(sortedIndex([5, 3, 2, 1], 4), 1, "Returns the lowest index at which value should be inserted into array in order to maintain its sort order.");
t.equal(sortedIndex([30, 50], 40), 1, "Returns the lowest index at which value should be inserted into array in order to maintain its sort order.");
test('Returns the lowest index at which value should be inserted into array in order to maintain its sort order.', () => {
expect(sortedIndex([5, 3, 2, 1], 4)).toBe(1)
});
test('Returns the lowest index at which value should be inserted into array in order to maintain its sort order.', () => {
expect(sortedIndex([30, 50], 40)).toBe(1)
});