api-boltAPIBolt

ApiBolt Test Engine (ABTestEngine)

A lightweight, powerful testing utility for validating API responses inside ApiBolt.

Core Idea

ABTestEngine provides multiple assertion layers:

status()HTTP status testing
body()Response body validation
headers()Headers validation
cookies()Cookies validation
group()Organize tests into blocks
print()Log values to console
code()Log formatted code blocks
summary()Generate visual summary
expect()All-In-One Unified API (Recommended)

Negation (.not)

Every assertion supports .not for logical inversion.

ts
ab.expect("Not 500").not.toBe(500);
ab.expect("No error").not.toBeServerError();
ab.expect("No password field").not.toHaveProperty("password");

Summary Matrix

Category Primary Method
Statusexpect()
Bodyexpect()
Headersexpect()
Cookiesexpect()
Negation.not

Final Note & Philosophy

If you are separately calling ab.status(), ab.body(), ab.headers(), and ab.cookies(), you are doing more work than needed. The expect() method is designed to behave like a mini-Jest framework inside ApiBolt.

"One method. Full control. Zero confusion."