BuckleScript bindings for dom-testing-library.
$ yarn add --dev bs-dom-testing-library
# or..
$ npm install --save-dev bs-dom-testing-library
{
"bs-dev-dependencies": [
"bs-dom-testing-library"
]
}
With bs-jest
/* Header_test.re */
open Jest;
open Expect;
open Webapi.Dom;
open Webapi.Dom.Element;
test("header exists", () => {
let div = Document.createElement("div", document);
div->setInnerHTML({|<h1>Hello, World!</h1>|});
div
|> getByText(~matcher=`Str("Hello, World!"))
|> expect
|> ExpectJs.toBeTruthy;
});
See src/__tests__
for some examples.
$ git clone https://github.com/wyze/bs-dom-testing-library.git
$ cd bs-dom-testing-library
$ yarn # or `npm install`
$ yarn build
$ yarn test
v0.4.1 (2019-04-24)
- Add documentation link to readme (@wyze in f5fb3dc)
- Add
getByLabelText
query (@wyze in 48acf68) - Run formatter (@wyze in 4fe146a)
MIT © Neil Kistner