bs-jest-dom
BuckleScript bindings for jest-dom.
Installation
$ yarn add --dev bs-jest-dom
$ npm install --save-dev bs-jest-dom
Usage
Add to bsconfig.json
{
"bs-dev-dependencies": [
"bs-jest-dom"
]
}
/* A_test.re */
open Jest;
open JestDom;
open ReactTestingLibrary;
module Heading = {
let component = ReasonReact.statelessComponent("Heading");
let make = (~text, _children) => {
...component,
render: _self =>
<h1> {ReasonReact.string(text)} </h1>,
};
};
test("renders with text", () =>
<Heading text="Hello, World!" />
|> render
|> getByText(~matcher=`Str("Hello, World!"))
|> expect
|> toBeInTheDocument
);
Examples
See src/__tests__
for some examples.
Development
$ git clone https://github.com/wyze/bs-jest-dom.git
$ cd bs-jest-dom
$ yarn
Build
$ yarn build
Test
$ yarn test
Change Log
Full Change Log
v1.0.0 (2018-09-18)
License
MIT © Neil Kistner