Why expect()?
expect()is the most powerful API in ABTestEngine
It operates in two modes:
- Value Mode — pass a second argument to assert against a specific value
- Response Mode — omit the second argument to test status, body, headers, and cookies
You can test everything from a single interface.
Value Mode
Pass a second argument to assert against a specific value directly.
ts
Response Mode
Omit the second argument to access .status, .body, .headers, and .cookies sub-chains.
ts
Expect API Full Documentation
Select a category on the sidebar to view all supported matchers.