0.9.2 • Published 3 years ago

@tomvardasca/rescript-react-testing-library v0.9.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@tomvardasca/rescript-react-testing-library · Build Status npm Codecov

ReScript bindings for react-testing-library.

Documentation

Read the docs | Edit the docs

Installation

$ yarn add --dev @tomvardasca/rescript-react-testing-library

# or..

$ npm install --save-dev @tomvardasca/rescript-react-testing-library

Usage

Add to bsconfig.json

{
  "bs-dev-dependencies": [
    "@tomvardasca/rescript-react-testing-library"
  ]
}

With bs-jest

/* Component_test.re */

open Jest;
open Expect;
open ReactTestingLibrary;

test("Component renders", () =>
  <div style=ReactDOM.Style.make(~color="rebeccapurple", ())>
    <h1> {React.string("Heading")} </h1>
  </div>
  |> render
  |> container
  |> expect
  |> toMatchSnapshot
);

Examples

See src/__tests__ for some examples.

Development

$ git clone https://github.com/tomvardasca/rescript-react-testing-library.git
$ cd rescript-react-testing-library
$ yarn # or `npm install`

Build

$ yarn build

Test

$ yarn test

Change Log

Full Change Log

v0.9.2 (2021-02-19)

License

MIT © Neil Kistner and Tomé Vardasca

Credits

This is a fork of the great work from Neil Kistner on bs-react-testing-library