BuckleScript bindings for jest-dom.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.editorconfig
.gitattributes
.gitignore
.travis.yml
bsconfig.json
changelog.md
license
package.json
readme.md
yarn.lock

readme.md

bs-jest-dom

Build Status npm Coveralls

BuckleScript bindings for jest-dom.

Installation

$ yarn add --dev bs-jest-dom

# or..

$ npm install --save-dev bs-jest-dom

Usage

Add to bsconfig.json

{
  "bs-dev-dependencies": [
    "bs-jest-dom"
  ]
}

With bs-jest and bs-react-testing-library

/* 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 # or `npm install`

Build

$ yarn build

Test

$ yarn test

Change Log

Full Change Log

v1.0.0 (2018-09-18)

License

MIT © Neil Kistner