testing/adversarial_404.ts

Adversarial 404 testing for routes with params and declared 404 error schemas.

Creates stub handlers that return 404 with the declared error code, fires requests with valid-format-but-nonexistent params (nil UUIDs), and validates response bodies against the route's declared 404.

No DB needed — tests schema conformance of 404 responses, not real handlers.

view source

Declarations
#

describe_adversarial_404
#

testing/adversarial_404.ts view source

(options: AdversarialTestOptions): void import {describe_adversarial_404} from '@fuzdev/fuz_app/testing/adversarial_404.js';

Generate adversarial 404 response validation tests.

For each route with params and a 404 definition of its own in errors:

  1. Creates a stub handler returning 404 with the first such definition's code
  2. Fires a request with valid-format params (nil UUIDs for UUID params)
  3. Validates response status is 404
  4. Validates the code is one the route's error map (resolve_route_error_map) declares at 404, and the body parses against its 404 (assert_error_schema_valid)

options

returns

void

Depends on
#

Imported by
#