Code Monkey home page Code Monkey logo

bs-jest-dom's Introduction

Neil Kistner (wyze)

overview languages

bs-jest-dom's People

Contributors

caulagi avatar jihchi avatar johnridesabike avatar wyze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bs-jest-dom's Issues

Upgrade peer deps

Peer deps should be updated. (bs-jest)

I think this happens for bs-react-testing-library bs-dom-testing-library too. (reason-react)

Is `JestDom.expect` compatible/interchangeable with `Jest.Expect.expect`?

bs-jest-dom: 4.0.0

For example, add following test case:

test("Jest.Expect.toEqual", () =>
  "Foo" |> expect |> Jest.Expect.toEqual("Foo")
);

to the file after line 480:

test("not toBeChecked", () =>
render({|<input type="checkbox" data-testid="input" />|})
|> queryByTestId("input")
|> expect
|> not_
|> toBeChecked
);

save and run yarn test, you will get following error:

  We've found a bug for you!
  /Users/jihchi/Repos/bs-jest-dom/src/__tests__/JestDom_test.re 483:12-17

  481 │ 
  482 │ test("Expect.toEqual", () =>
  483 │   "Foo" |> expect |> Expect.toEqual("Foo")
  484 │ );

  This has type:
    JestDom.t => JestDom.expect
  But somewhere wanted:
    string => 'a

  The incompatible parts:
    JestDom.t (defined as
      Dom.eventTarget_like(Dom._node(Dom._element(Dom._baseClass))))
    vs
    string

Is that expected?

bs-react-testing-library example doesn't work

The example from the README with bs-react-testing-library doesn't seem to work after upgrading to 2.0.0

open Jest;
open Expect;
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 in the document", () =>
  <Heading text="Hello, World!" />
  |> render
  |> getByText(~matcher=`Str("Hello, World!"))
  |> expect
  |> toBeInTheDocument
);

gives the following error

 19 │   |> getByText(~matcher=`Str("Hello, World!"))
  20 │   |> expect
  21 │   |> toBeInTheDocument
  22 │ );

  This has type:
    ([< (JestDom.t)JestDom.modifier ] as 'a) => Jest.assertion
  But somewhere wanted:
    Jest.Expect.plainPartial(Dom.element) => 'b

  The incompatible parts:
    'a (defined as [< `Just(JestDom.t) ])
    vs
    Jest.Expect.plainPartial(Dom.element) (defined as [ `Just(Dom.element) ])

    Further expanded:
      JestDom.t (defined as option(Dom.element))
      vs
      Dom.element (defined as
        Dom.eventTarget_like(Dom._node(Dom._element(Dom._baseClass))))
  Types for tag `Just are incompatible

I am using "bs-jest-dom": "^2.0.0" and "bs-react-testing-library": "^0.4.0". Am I missing something?

incompatibility with bs-platform >= 4.0.6

Steps to reproduce:

  • clone bs-jest-dom
  • remove yarn.lock & run yarn install run yarn add [email protected]
  • run yarn test to trigger compilation

Error:

  We've found a bug for you!
  /Users/pnore/dev/bs-jest-dom/src/JestDom.re
  
  The implementation src/JestDom.mlast
       does not match the interface src/jestDom.cmi:
       The value `not__' is required but not provided

This is from the change mentioned in the glennsl/bs-jest#41 issue included in 0.4.7, which I think was introduced with [email protected].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.