Files
30-seconds-of-code/test/binarySearch/binarySearch.test.js
Angelos Chalaris 5afe81452a Migrated tests to jest
Used jest-codemods to migrate, will have to pass everything by hand before we can merge.
2018-06-18 14:18:25 +03:00

13 lines
593 B
JavaScript

const expect = require('expect');
const binarySearch = require('./binarySearch.js');
test('Testing binarySearch', () => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
expect(typeof binarySearch === 'function').toBeTruthy();
//t.deepEqual(binarySearch(args..), 'Expected');
expect(binarySearch([1, 4, 6, 7, 12, 13, 15, 18, 19, 20, 22, 24], 6)).toBe(2);
expect(binarySearch([1, 4, 6, 7, 12, 13, 15, 18, 19, 20, 22, 24], 21)).toBe(-1);
expect(binarySearch([], 21)).toBe(-1);
expect(binarySearch([1], 1)).toBe(0);
});