Testing for the type of the returned value of one function call is not really proving that it always returns a number, so it's not necessary. Every other test depends on the result being a number, so you are implicitly testing for that.
There's no need to use such long inputs, you can prove that it works with easier to type arrays (and it's nicer for the person who's reading your tests).
Binary search functionality for indexOf should be part of the same method, not a different one. All the same tests should pass for both "modes" of the function.
I don't fully understand what you are doing in lines 428-429. Why not test the same way you tested for the whole file? There's no need to use this
Testing for the type of the returned value of one function call is not really proving that it always returns a number, so it's not necessary. Every other test depends on the result being a number, so you are implicitly testing for that.
There's no need to use such long inputs, you can prove that it works with easier to type arrays (and it's nicer for the person who's reading your tests).
https://github.com/jonsey247/Lowbar/blob/eb0016ddad7d9bb3d94725fafe129fd0a46968b3/spec/lowbar.spec.js#L120-141
Binary search functionality for
indexOf
should be part of the same method, not a different one. All the same tests should pass for both "modes" of the function.I don't fully understand what you are doing in lines 428-429. Why not test the same way you tested for the whole file? There's no need to use
this
https://github.com/jonsey247/Lowbar/blob/eb0016ddad7d9bb3d94725fafe129fd0a46968b3/spec/lowbar.spec.js#L424-L437
||
?https://github.com/jonsey247/Lowbar/blob/eb0016ddad7d9bb3d94725fafe129fd0a46968b3/lowbar.js#L308