Test cleanup and fixes [s-t]

This commit is contained in:
Angelos Chalaris
2018-06-18 18:37:35 +03:00
parent ba3e684a27
commit 9cf2c4680c
53 changed files with 286 additions and 409 deletions

View File

@ -1,14 +1,12 @@
const expect = require('expect');
const sortedIndex = require('./sortedIndex.js');
test('sortedIndex is a Function', () => {
test('sortedIndex is a Function', () => {
expect(sortedIndex).toBeInstanceOf(Function);
});
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([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)
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);
});