Files
30-seconds-of-code/test/sortedIndex/sortedIndex.test.js
Angelos Chalaris 4f7da1be9b Test migration to jest by hand
Apparently using regular expressions is way easier.
2018-06-18 15:15:56 +03:00

11 lines
489 B
JavaScript

const expect = require('expect');
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.");