Skip to content

[Feature]: Add .request() testing helper to KitoRouter and KitoServer** #45

Description

@nglmercer

Summary

adds a high-level testing utility to simplify writing integration tests for Kito applications. Currently, testing requires manual context mocking and internal property access, which is verbose and couples tests to implementation details.

Motivation

simplify testing

Proposed Solution

Changes

  • Add request() method to KitoRouter and KitoServer classes
  • Create a TestRequestBuilder that provides a fluent API for constructing test requests
  • Support common HTTP methods (GET, POST, PUT, DELETE, PATCH, etc.)
  • Support setting headers, query params, body, and cookies
  • Return a TestResponse object with assertions helpers

Testing

  • Add unit tests for the request() method
  • Migrate existing integration tests to use the new helper
  • Ensure backward compatibility with existing test patterns

Checklist

  • I've searched for related issues
  • I've read the documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions