-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TestClient generated using NodeTesting requires body, path, query, params as any
#645
Comments
Hey, I'm not able to reproduce. Please make sure there are no mismatching dependency versions in your package or other type errors. Otherwise, I'll need a repro to take a look. import { Schema } from "@effect/schema"
import { Effect, pipe } from "effect"
import { Api, RouterBuilder } from "effect-http"
import { NodeTesting } from "effect-http-node"
const testApi = Api.make().pipe(
Api.addEndpoint(
pipe(
Api.get("test", "/test"),
Api.setResponseBody(Schema.String)
)
)
)
const app = RouterBuilder.make(testApi).pipe(
RouterBuilder.handle(
"test",
() => Effect.succeed("ok")
),
RouterBuilder.build
)
const testClient = NodeTesting.make(app, testApi)
// Using the client:
Effect.gen(function*() {
const client = yield* testClient
// test: (input: {}, map?: ((request: HttpClientRequest) => HttpClientRequest) | undefined) => Effect.Effect<string, ClientError<number>, never>
const result = yield* client.test({})
console.log(result)
}) |
my appologies @sukovanej , It was coming from the I'm unsure if this is a typescript limitation or the types can be improved to handle the case of using |
I'll try to dig deeper, but it is very probably an issue with the |
Example:
Seems like extra props in type show as
any
. Since they are not defined on the spec, they shouldn't be allowedUpdated the code, it seems to come from the
flow
based addition of securityThe text was updated successfully, but these errors were encountered: