BuckleScript bindings for react-testing-library.
$ yarn add --dev bs-react-testing-library
# or..
$ npm install --save-dev bs-react-testing-library
{
"bs-dev-dependencies": [
"bs-react-testing-library"
]
}
With bs-jest
/* Component_test.re */
open Jest;
open Expect;
open ReactTestingLibrary;
test("Component renders", () =>
<div style=ReactDOMRe.Style.make(~color="rebeccapurple", ())>
<h1> {ReasonReact.string("Heading")} </h1>
</div>
|> render
|> container
|> expect
|> toMatchSnapshot
);
See src/__tests__
for some examples.
$ git clone https://github.com/wyze/bs-react-testing-library.git
$ cd bs-react-testing-library
$ yarn # or `npm install`
$ yarn build
$ yarn test
v0.5.0 (2019-04-24)
- Meta file updates (@wyze in 9e91c93)
- Fix
FireEvent
module (@wyze in 2e709fd) - Upgrade dependencies (@wyze in cd924da)
- Improve readme example (@benadamstyles in #2)
MIT © Neil Kistner