Skip to content

Releases: mustafaautomation/api-testing-suite

v2.0.0 — Enterprise Grade

08 Mar 19:38

Choose a tag to compare

What's New in v2.0.0

Complete enterprise-grade upgrade with production-ready patterns.

ApiClient Factory Pattern

  • createApiClient() factory replaces singleton — proper test isolation
  • Each test suite gets its own client instance
  • Chainable configuration: .withToken(), .enableRetry(), .enableLogging()

Retry with Exponential Backoff

  • 3 attempts with 500ms → 1000ms → 2000ms delays
  • Smart retry: 5xx and network errors retried, 4xx fail fast
  • Configurable via enableRetry({ attempts, baseDelay })

Request Logging

  • [API] GET /users → 200 (142ms) format to stderr
  • Toggle with .enableLogging() / .disableLogging()

Test Quality

  • 41 tests across 4 test suites (auth, users, contracts, client)
  • Proper test isolation with factory pattern and afterAll cleanup
  • beforeAll guards throw on login failure instead of silently failing
  • Pagination tests use proper disjoint check
  • Contract tests use consistent test data fixtures
  • Client unit tests cover retry behavior, 4xx no-retry, logging

Infrastructure

  • GitHub Actions v4 (v6/v7 don't exist — fixed)
  • test:ci script with --runInBand --forceExit for CI
  • mkdir -p reports in CI before test run
  • tsconfig includes test files in type-checking
  • 15s test timeout for external API calls
  • dotenv loaded via jest setupFiles (no side-effect imports)

Code Quality

  • assertJsonHeaders throws Error instead of using Jest expect()
  • UpdateUserResponse type exported for consistency
  • Dockerfile uses npm test instead of npx jest
  • README test counts verified accurate (41 tests)

Built by Quvantic