From 41e3ba26e5bbc15e9b02fb516e66417bdf0661fe Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Tue, 14 Nov 2023 21:51:23 -0800 Subject: [PATCH] feat: support melange v3 --- src/ReactDOMTestUtils.re | 4 +++- src/ReasonReactRouter.re | 8 ++++---- test/React__test.re | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ReactDOMTestUtils.re b/src/ReactDOMTestUtils.re index 82c5d606d..9f0c96492 100644 --- a/src/ReactDOMTestUtils.re +++ b/src/ReactDOMTestUtils.re @@ -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)), ()) => { diff --git a/src/ReasonReactRouter.re b/src/ReasonReactRouter.re index 89603b17a..0c4cc7376 100644 --- a/src/ReasonReactRouter.re +++ b/src/ReasonReactRouter.re @@ -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=?, ()) => @@ -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 | _ => "" } diff --git a/test/React__test.re b/test/React__test.re index 8b26c8339..73b646628 100644 --- a/test/React__test.re +++ b/test/React__test.re @@ -335,7 +335,7 @@ describe("React", () => { fallback={({error: _, info}) => { expect( info.componentStack - ->Js.String2.includes("ComponentThatThrows"), + ->Js.String.includes(~sub="ComponentThatThrows"), ) ->toBe(true); "An error occured"->React.string ;