No results for

Powered byAlgolia

toBeLessThanOrEqual( expectedValue )

suggest edits

toBeLessThanOrEqual(expectedValue) is a comparison function that evaluates to true or false. It must be called in the chain after the t.expect(value) or .and(value).

toBeLessThanOrEqual is equivalent to received <= expected

When toBeLessThanOrEqual(expectedValue) evaluates to false, the chain is broken, and the test is marked as failed. When the chain is broken, further checks inside of the test are omitted.

expectedValueanyThe expected value


FunkFunk object


import { describe } from '';
import http from 'k6/http';
export default function testSuite() {
describe('Basic API test', (t) => {
t.expect(5).toBeLessThanOrEqual(6); // true
t.expect(5).toBeLessThanOrEqual(5); // true
t.expect(5).toBeLessThanOrEqual(4); // false