Skip to content

Update to @rescript/react #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Setup Deno 0.40
uses: denolib/setup-deno@220d9c6
uses: denolib/setup-deno@v2
with:
deno-version: '0.40'
- run: yarn install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"suffix": ".bs.js",
"bs-dependencies": [
"bs-dom-testing-library",
"reason-react"
"@rescript/react"
],
"bs-dev-dependencies": [
"@glennsl/bs-jest",
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@
"testing"
],
"dependencies": {
"@testing-library/react": "^11.1.0",
"@testing-library/react": "^11.2.5",
"bs-dom-testing-library": "^0.7.0"
},
"peerDependencies": {
"reason-react": "< 0.8.0"
"@rescript/react": "0.10.1"
},
"devDependencies": {
"@glennsl/bs-jest": "^0.5.1",
"@glennsl/bs-jest": "^0.6.0",
"@sheerun/mutationobserver-shim": "^0.3.3",
"@wyze/changelog": "^1.0.0",
"@wyze/github-release": "^1.1.1",
"bisect_ppx": "^2.5.0",
"bs-platform": "^8.3.1",
"bs-platform": "^8.4.2",
"npm-run-all": "^4.1.5",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"reason-react": "^0.9.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"@rescript/react": "^0.10.1",
"rimraf": "^3.0.2"
}
}
4 changes: 2 additions & 2 deletions src/ReactTestingLibrary.re
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let act = callback =>
});

[@bs.module "@testing-library/react"]
external _render: (ReasonReact.reactElement, renderOptions) => renderResult =
external _render: (React.element, renderOptions) => renderResult =
"render";

[@bs.get] external container: renderResult => Dom.element = "container";
Expand All @@ -44,7 +44,7 @@ external _debug: (Js.undefined(Dom.element), Js.undefined(int)) => unit =
[@bs.send.pipe: renderResult] external unmount: unit => bool = "unmount";

[@bs.send.pipe: renderResult]
external rerender: ReasonReact.reactElement => unit = "rerender";
external rerender: React.element => unit = "rerender";

[@bs.send.pipe: renderResult]
external asFragment: unit => Dom.element = "asFragment";
Expand Down
4 changes: 2 additions & 2 deletions src/ReactTestingLibrary.rei
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ let findAllByTestId:
Js.Promise.t(array(Dom.element));

[@bs.send.pipe: renderResult]
external rerender: ReasonReact.reactElement => unit = "rerender";
external rerender: React.element => unit = "rerender";

let render:
(
Expand All @@ -691,7 +691,7 @@ let render:
~hydrate: bool=?,
~wrapper: Dom.element=?,
~queries: queries=?,
ReasonReact.reactElement
React.element
) =>
renderResult;

Expand Down
15 changes: 7 additions & 8 deletions src/__tests__/ReactTestingLibrary_test.re
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ afterAll(Bisect.Runtime.write_coverage_data);

module Greeting = {
[@react.component]
let make = (~message) => <div> {ReasonReact.string(message)} </div>;
let make = (~message) => <div> {React.string(message)} </div>;
};

module Counter = {
Expand All @@ -27,12 +27,12 @@ module Counter = {
);

<div>
{ReasonReact.string("Count: " ++ string_of_int(state))}
{React.string("Count: " ++ string_of_int(state))}
<button onClick={_event => dispatch(Inc)}>
{ReasonReact.string("+")}
{React.string("+")}
</button>
<button onClick={_event => dispatch(Dec)}>
{ReasonReact.string("-")}
{React.string("-")}
</button>
</div>;
};
Expand All @@ -47,11 +47,10 @@ describe("ReactTestingLibrary", () => {
open Expect;

let element =
<div style={ReactDOMRe.Style.make(~color="rebeccapurple", ())}>
{ReasonReact.cloneElement(
<div style={ReactDOM.Style.make(~color="rebeccapurple", ())}>
{React.cloneElement(
<h1 />,
~props={"data-testid": "h1-heading"},
[|ReasonReact.string("Heading")|],
{"data-testid": "h1-heading", "children": React.string("Heading")},
)}
</div>;

Expand Down
Loading