Skip to content

Commit

Permalink
feat: support melange v3
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Nov 15, 2023
1 parent 5a1127f commit 41e3ba2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/ReactDOMTestUtils.re
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ module DOM = {

let findBySelectorAndPartialTextContent = (element, selector, content) =>
querySelectorAll(element, selector)
|> Array.find_opt(node => node->textContent->Js.String2.includes(content));
|> Array.find_opt(node =>
node->textContent->Js.String.includes(~sub=content)
);
};

let prepareContainer = (container: ref(option(Dom.element)), ()) => {
Expand Down
8 changes: 4 additions & 4 deletions src/ReasonReactRouter.re
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ let pathParse = str =>
};
/* remove search portion if present in string */
let raw =
switch (raw |> Js.String.splitAtMost("?", ~limit=2)) {
switch (raw |> Js.String.splitAtMost(~sep="?", ~limit=2)) {
| [|path, _|] => path
| _ => raw
};

raw
|> Js.String.split("/")
|> Js.Array.filter(item => String.length(item) != 0)
|> Js.String.split(~sep="/")
|> Js.Array.filter(~f=item => String.length(item) != 0)
|> arrayToList;
};
let path = (~serverUrlString=?, ()) =>
Expand Down Expand Up @@ -117,7 +117,7 @@ let searchParse = str =>
| ""
| "?" => ""
| raw =>
switch (raw |> Js.String.splitAtMost("?", ~limit=2)) {
switch (raw |> Js.String.splitAtMost(~sep="?", ~limit=2)) {
| [|_, search|] => search
| _ => ""
}
Expand Down
2 changes: 1 addition & 1 deletion test/React__test.re
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ describe("React", () => {
fallback={({error: _, info}) => {
expect(
info.componentStack
->Js.String2.includes("ComponentThatThrows"),
->Js.String.includes(~sub="ComponentThatThrows"),
)
->toBe(true);
<strong> "An error occured"->React.string </strong>;
Expand Down

0 comments on commit 41e3ba2

Please sign in to comment.