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.
|name||string||Test case name|
|function||function||The function to be executed|
|bool||Returns true when all expect and and conditions within the describe() body were successful, and no unhandled exceptions were raised, otherwise false.|
Execution of this script should print the following output.