From bb7176e7e71f045183674a11478e44b7630f5351 Mon Sep 17 00:00:00 2001 From: Mateus Date: Tue, 28 May 2024 08:12:00 -0300 Subject: [PATCH 1/4] fix: adjust ClauseInCaseTest to new module format --- tests/Install/ClauseInCaseTest.elm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/Install/ClauseInCaseTest.elm b/tests/Install/ClauseInCaseTest.elm index 18f183e..4d71190 100644 --- a/tests/Install/ClauseInCaseTest.elm +++ b/tests/Install/ClauseInCaseTest.elm @@ -1,12 +1,17 @@ module Install.ClauseInCaseTest exposing (all) -import Install.ClauseInCase exposing (rule) +import Install.ClauseInCase exposing (init, makeRule) import Review.Test import Test exposing (Test, describe, test) all : Test all = + let + rule = + init "REPLACEME" "REPLACEME" "REPLACEME" "REPLACEME" + |> makeRule + in describe "Install.ClauseInCase" [ test "should not report an error when REPLACEME" <| \() -> From 58dcd3c2a38c80a783adf83eb8ce18aa7158633e Mon Sep 17 00:00:00 2001 From: mateusfpleite Date: Tue, 28 May 2024 08:22:17 -0300 Subject: [PATCH 2/4] avoid errors while tests are not ready --- tests/Install/ClauseInCaseTest.elm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/Install/ClauseInCaseTest.elm b/tests/Install/ClauseInCaseTest.elm index 4d71190..7f8e91e 100644 --- a/tests/Install/ClauseInCaseTest.elm +++ b/tests/Install/ClauseInCaseTest.elm @@ -26,11 +26,13 @@ a = 1 a = 1 """ |> Review.Test.run rule - |> Review.Test.expectErrors - [ Review.Test.error - { message = "REPLACEME" - , details = [ "REPLACEME" ] - , under = "REPLACEME" - } - ] + |> Review.Test.expectNoErrors + + -- |> Review.Test.expectErrors + -- [ Review.Test.error + -- { message = "REPLACEME" + -- , details = [ "REPLACEME" ] + -- , under = "REPLACEME" + -- } + -- ] ] From d692739e5b87657b948e12a7c67def8245b6721c Mon Sep 17 00:00:00 2001 From: Mateus Date: Tue, 28 May 2024 08:28:25 -0300 Subject: [PATCH 3/4] remove unused import --- src/Install/ClauseInCase.elm | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Install/ClauseInCase.elm b/src/Install/ClauseInCase.elm index ff23a9c..000655b 100644 --- a/src/Install/ClauseInCase.elm +++ b/src/Install/ClauseInCase.elm @@ -52,7 +52,6 @@ import Elm.Syntax.ModuleName exposing (ModuleName) import Elm.Syntax.Node as Node exposing (Node(..)) import Elm.Syntax.Pattern exposing (Pattern(..)) import Elm.Syntax.Range exposing (Range) -import List exposing (range) import List.Extra import Review.Fix as Fix exposing (Fix) import Review.Rule as Rule exposing (Error, Rule) From 3f02e51e7db9f2eaa85d9bae81dafac8e65619e0 Mon Sep 17 00:00:00 2001 From: Mateus Date: Tue, 28 May 2024 08:37:29 -0300 Subject: [PATCH 4/4] fix preview to match ClauseInCase changes --- preview/elm.json | 4 +++- preview/src/ReviewConfig.elm | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/preview/elm.json b/preview/elm.json index 57153a0..528ae3b 100644 --- a/preview/elm.json +++ b/preview/elm.json @@ -8,6 +8,7 @@ "dependencies": { "direct": { "elm/core": "1.0.5", + "elmcraft/core-extra": "2.0.0", "jfmengels/elm-review": "2.13.2", "stil4m/elm-syntax": "7.3.2" }, @@ -18,6 +19,7 @@ "elm/parser": "1.1.0", "elm/project-metadata-utils": "1.0.2", "elm/random": "1.0.0", + "elm/regex": "1.0.0", "elm/time": "1.0.0", "elm/virtual-dom": "1.0.3", "elm-explorations/test": "2.2.0", @@ -32,4 +34,4 @@ }, "indirect": {} } -} \ No newline at end of file +} diff --git a/preview/src/ReviewConfig.elm b/preview/src/ReviewConfig.elm index d5264fb..717546c 100644 --- a/preview/src/ReviewConfig.elm +++ b/preview/src/ReviewConfig.elm @@ -17,5 +17,10 @@ import Review.Rule exposing (Rule) config : List Rule config = - [ Install.ClauseInCase.rule + [ Install.ClauseInCase.init + "Backend" + "updateFromFrontend" + "ResetCounter" + "( { model | counter = 0 }, broadcast (CounterNewValue 0 clientId) )" + |> Install.ClauseInCase.makeRule ]