BuckleScript bindings for react-test-renderer.
$ yarn add --dev bs-react-test-renderer
# or..
$ npm install --save-dev bs-react-test-renderer
{
"bs-dev-dependencies": [
"bs-react-test-renderer"
]
}
With bs-jest
/* Component_test.re */
open Jest;
describe("Component", () => {
open ExpectJs;
test("renders", () => {
let component = ReactShallowRenderer.renderWithRenderer(<Component />);
expect(Js.Undefined.return(component)) |> toBeDefined;
});
});
See src/__tests__
for some examples.
For examples with Snapshot testing with bs-jest
, see reason-calculator
.
$ git clone https://github.com/reasonml-community/bs-react-test-renderer.git
$ cd bs-react-test-renderer
$ yarn # or `npm install`
$ yarn build
$ yarn test
v3.0.0 (2020-08-28)
- Upgrade to my latest release tools (@wyze in #19)
- Upgrade dependencies (@wyze in #18)
- Migrate to JSX v3 (@rusty-key in #10)
- Upgrade CI to use Current and LTS Node versions (@wyze in #11)
- Fixes Bucklescript v7 warnings (@superherointj in #4)
MIT © Neil Kistner