mockserver-client-node icon indicating copy to clipboard operation
mockserver-client-node copied to clipboard

Export `MockServerClient` class' type using `index.d.ts`

Open botflux opened this issue 1 year ago • 0 comments

Describe the feature request Export the type MockServerClient through the main type file.

What you are trying to do I'm writing test files in which I initialize a mockserver client in a before hook, like the following.

// The type `MockServerClient` is not exported by `mockserver-client`
import { mockServerClient, MockServerClient } from "mockserver-client"

let client!: MockServerClient

before(() => client = mockServerClient("localhost", 1080))

image

The solution you'd like

I would like the MockServerClient type to be exported by index.d.ts, so the precedent example can compile.

Describe alternatives you've considered

MockServerClient is currently available by importing "mockserver-client/mockServerClient" like the following:

import { mockServerClient } from "mockserver-client"
import { MockServerClient } from "mockserver-client/mockServerClient"

let client!: MockServerClient

before(() => client = mockServerClient("localhost", 1080))

I'm using the version 5.15.0.

botflux avatar May 28 '24 14:05 botflux