.toBeLessThanOrEqual(number)

To compare floating point numbers, you can use toBeLessThanOrEqual. For example, if you want to test that ouncesPerCan() returns a value of at most 12 ounces, write:

  1. test('ounces per can is at most 12', () => {
  2. expect(ouncesPerCan()).toBeLessThanOrEqual(12);
  3. });