@rescriptbr/react-testing-library
ReScript bindings for react-testing-library.
Documentation
The documentation is WIP, see src/__tests__
for some examples.
Installation
$ yarn add --dev @rescriptbr/react-testing-library
# or..
$ npm install --save-dev @rescriptbr/react-testing-library
Usage
bsconfig.json
Add to {
"bs-dev-dependencies": [
"@rescriptbr/react-testing-library"
]
}
bs-jest
With 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/wyze/bs-react-testing-library.git
$ cd bs-react-testing-library
$ yarn # or `npm install`
Build
$ yarn build
Test
$ yarn test
Change Log
v1.0.0 (2021-04-21)
Credits
See CREDITS.md
License
MIT ©