@alexcardell/bs-supertest
v0.1.1-alpha.0
Published
[![CircleCI][ci-badge]][ci-link] [![NPM][npm-badge]][npm-link] [![MIT License][license-badge]][license-link]
Readme
bs-supertest
ReasonML bindings for supertest.
Installing
yarn add --dev @alexcardell/bs-supertestDon't forget to @alexcardell/bs-supertest
to the bs-dev-dependencies list in bsconfig.json.
Note: Requires supertest as a peer dependency in package.json
(not in bsconfig.json though).
Usage
An example with bs-jest
let message = err =>
err
|> Js.Exn.message
|> Belt.Option.getExn;
testAsync("a test", finish => {
let app = make(); /* Your Express server */
app
|> Supertest.request
|> Supertest.expectStatus(200)
|> Supertest.end_(
fun
| Ok(_) => finish(pass)
| Error(err) =>
message(err) |> fail |> finish
);
});See the tests for more examples, and the source for all the bindings.
Contributions
Issues and PRs welcome.
