bs-react-test-renderer
BuckleScript bindings for react-test-renderer.
Installation
$ yarn add --dev bs-react-test-renderer
$ npm install --save-dev bs-react-test-renderer
Usage
Add to bsconfig.json
{
"bs-dev-dependencies": [
"bs-react-test-renderer"
]
}
// Component_test.re
open Jest;
open ExpectJs;
let _ =
describe "Component" (fun _ => {
test "renders" (fun _ => {
let component = ReactShallowRenderer.renderWithRenderer <Component />;
expect (Js.Undefined.return component) |> toBeDefined;
});
});
Examples
See src/__tests__
for some examples.
For examples with Snapshot testing with bs-jest
, see reason-calculator
.
Development
$ git clone https://github.com/BuckleTypes/bs-react-test-renderer.git
$ cd bs-react-test-renderer
$ yarn
Build
$ yarn build
Test
$ yarn test
Change Log
Full Change Log
v1.0.1 (2017-07-06)
- [
35a6736811
] - Update to reason-react v0.2.1 (Cheng Lou)
License
MIT © Neil Kistner