api-boltAPIBolt

ApiBolt Test Engine (ABTestEngine)

A full-featured API testing DSL inside ApiBolt. Every line executes immediately and stores a test result.

Core Idea

ABTestEngine provides multiple assertion layers:

status()HTTP status testing
body()Response body validation
headers()Headers validation
cookies()Cookies validation
ab.envEnvironment variable access
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 — dual mode: value or response

Negation (.not)

Every assertion supports .not for logical inversion. It flips only the last executed test.

ts
ab.status("check").not.toBe(200);
ab.body("check").not.toContain("error");
ab.headers("check").not.toHaveHeader("x-powered-by");
ab.cookies("session").not.toBe("invalid");

Summary Matrix

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

Final Rules & Philosophy

  • Every call immediately creates a test result.
  • expect() is dual mode — pass a value, or test the full response.
  • No chaining like Jest — each assertion is independent.
  • Headers are case-insensitive.
  • Cookies support optional name lookup or full-list access with ab.cookies().
  • .not flips only the last executed test.
  • Grouping isolates test blocks for clean reporting.
"One method. Full control. Zero confusion."