No results for

Powered byAlgolia

expect( value )

warning!

expect.js library is no longer maintained

expect.js library has been deprecated in favor of Chaijs.

Please migrate to the k6Chaijs library. The documentation below is retained for historical reasons.

expect(value) sets the value to be used in comparison by the next function in the chain.

ParameterTypeDescription
valueanyThe value to be compared

Returns

TypeDescription
FunkFunk object

Example

import { describe } from 'https://jslib.k6.io/expect/0.0.4/index.js';
import http from 'k6/http';
export default function testSuite() {
describe('Basic API test', (t) => {
const response = http.get('https://test-api.k6.io/public/crocodiles');
t.expect(response.status).toEqual(200);
});
}