Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bs-jest-dom

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bs-jest-dom

BuckleScript bindings for jest-dom.

  • 4.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bs-jest-dom · Build Status npm Codecov

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
/* Heading_test.re */

open Jest;
open JestDom;
open ReactTestingLibrary;

module Heading = {
  [@react.component]
  let make = (~text) => <h1> {ReasonReact.string(text)} </h1>;
};

test("renders in the document", () =>
  <Heading text="Hello, World!" />
  |> render
  |> getByText(~matcher=`Str("Hello, World!"))
  |> expect
  |> toBeInTheDocument
);
With bs-jest and bs-webapi
/* Heading_test.re */

open Jest;
open JestDom;
open Webapi.Dom;
open Webapi.Dom.Element;

test("heading is visible", () => {
  let div = Document.createElement("div", document);

  div->setInnerHTML("<h1>Hello, World!</h1>");

  div
  |> querySelector("h1")
  |> expect
  |> toBeVisible;
});

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

v4.1.1 (2020-06-17)

  • Fix JSX and bs-webapi to compile on BS 8 (@johnridesabike in #20)

License

MIT © Neil Kistner

Keywords

FAQs

Package last updated on 18 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc