{"size": 495, "ext": "js", "max_stars_repo_path": "src/algorithm/search.test.js", "max_stars_repo_name": "mrrs878/review", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/algorithm/search.test.js", "max_issues_repo_name": "mrrs878/review", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/algorithm/search.test.js", "max_forks_repo_name": "mrrs878/review", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.1176470588, "max_line_length": 60, "alphanum_fraction": 0.602020202}
/*
 * @Date: 2021-06-13 17:08:07
 * @Author: mrrs878@foxmail.com
 * @LastEditors: mrrs878@foxmail.com
 * @LastEditTime: 2021-06-13 18:01:26
 * @FilePath: \review\src\algorithm\search.test.js
 */
import { binarySearch } from './search';

describe('search problems', () => {
  test('binarySearch', () => {
    expect(binarySearch([1, 2, 3, 4, 5, 6], 3)).toEqual(2);
    expect(binarySearch([1, 2, 3, 4, 5, 6], 7)).toEqual(-1);
    expect(binarySearch([1, 2, 3, 4, 5, 6], 2)).toEqual(1);
  });
});
