@tomvardasca/rescript-react-testing-library
v0.9.2
Published
ReScript bindings for react-testing-library.
Downloads
47
Maintainers
Readme
@tomvardasca/rescript-react-testing-library ·
ReScript bindings for react-testing-library.
Documentation
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
v0.9.2 (2021-02-19)
- Update readme.md (@tomvardasca in 1337603)
- Update readme credits (@tomvardasca in 3d89f55)
License
MIT © Neil Kistner and Tomé Vardasca
Credits
This is a fork of the great work from Neil Kistner on bs-react-testing-library