Skip to content

Allow apiClient to accept Express app instance #16

@michaelnjuguna

Description

@michaelnjuguna

Problem

Currently, the apiClient plugin only accepts a URL string (or an options object with baseURL).
I would like to pass an Express app instance directly for testing, similar to how Supertest works,
so that we can run tests without starting a server on a real port.

Suggested solution

Allow apiClient to accept an Express app instance and internally handle requests against it.

Use case

This would allow faster tests in CI environments and eliminate port conflicts during testing.

Example:

import app from './app'
apiClient(app) // currently not supported

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions