Skip to content

Response with S.string data doesn't work in Fastify #7

@DZakh

Description

@DZakh
asyncTest("Test string data response", async t => {
  let route = Rest.route(() => {
    path: "/test",
    method: Post,
    input: _ => (),
    responses: [s => s.data(S.string)],
  })

  try {
    let app = Fastify.make()
    app->Fastify.route(route, async _ => "foo")
    let client = Rest.client(~baseUrl="http://localhost:3000", ~fetcher=args => app->inject(args))
    t->Assert.deepEqual(await client.call(route, ()), "foo")
  } catch {
  | _ => {
      Js.log(%raw(`exn`))
      Js.Exn.raiseError("foo")
    }
  }
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions