BuckleScript bindings for react-test-renderer.
$ yarn add --dev bs-react-test-renderer
# or..
$ npm install --save-dev bs-react-test-renderer
bsconfig.json
{
"bs-dev-dependencies": [
"bs-react-test-renderer"
]
}
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
MIT © Neil Kistner