In Jasmine, there are toBeGreaterThan and toBeLessThan matchers.
toBeGreaterThan
toBeLessThan
What if I want to check an integer value in a specific range? Is there any
You can run the boolean comparison and assert the result is true:
true
expect(x > 1 && x < 10).toBeTruthy();
Also, there is toBeWithinRange() custom matcher introduced by jasmine-matchers:
toBeWithinRange()
expect(x).toBeWithinRange(2, 9); // range borders are included