No results for

Powered byAlgolia
⚠️ This is archived documentation for v0.31. Go to the latest version

describe( name, function )

suggest edits

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() {
let success1 = describe('Basic test', (t) => {
console.log(success1); // true
let success2 = describe('Another test', (t) => {
throw("Something entirely unexpected happened");
console.log(success2); // false
let success3 = describe('Yet another test', (t) => {
console.log(success3); // false

Execution of this script should print the following output.