No results for

Powered byAlgolia

describe( name, function )


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.

To declare a new test case you call the describe(name, function) function. Provide the required name and implementation function. Names should be unique within the script, otherwise, the test cases will to be grouped.

Note: The first argument of the implementation function should be named t.

Behind the scenes, the describe() function creates a k6 group.

namestringTest case name
functionfunctionThe function to be executed


boolReturns true when all expect and and conditions within the describe() body were successful, and no unhandled exceptions were raised, otherwise false.


import { describe } from '';
import http from 'k6/http';
export default function testSuite() {
const success1 = describe('Basic test', (t) => {
console.log(success1); // true
const success2 = describe('Another test', (t) => {
throw 'Something entirely unexpected happened';
console.log(success2); // false
const success3 = describe('Yet another test', (t) => {
console.log(success3); // false

Execution of this script should print the following output.