Skip to content

Repository files navigation

@tomvardasca/rescript-react-testing-library · Build StatusnpmCodecov

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 */openJest;
openExpect;
openReactTestingLibrary;
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

About

ReScript bindings for react-testing-library.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages