Skip to content

Add tests for proxy request forwarding, authentication, and error handling #14

@KochC

Description

@KochC

Problem

All three existing tests cover only CORS headers. The core proxy behaviour — request forwarding to upstream, authentication token validation, and error responses — has no test coverage.

Why now

Any change to index.js request-handling logic can silently break auth or forwarding with no CI signal.

Acceptance criteria

  • Test: valid auth token results in proxied request to upstream
  • Test: missing or invalid auth token returns HTTP 401
  • Test: upstream timeout or error returns HTTP 502
  • Test: malformed JSON body returns HTTP 400
  • All new tests pass in npm test

Target files

  • index.test.js
  • index.js

Suggested validation

  • npm test passes with all new cases
  • Each test asserts a specific status code and response body

Created by autobot — risk: low

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions