Skip to content

Commit

Permalink
Merge pull request #2 from mateusfpleite/main
Browse files Browse the repository at this point in the history
Fix ClauseInCaseTest.elm
  • Loading branch information
jxxcarlson authored May 28, 2024
2 parents c7d313d + 3f02e51 commit 2b21bac
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
4 changes: 3 additions & 1 deletion preview/elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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",
Expand All @@ -32,4 +34,4 @@
},
"indirect": {}
}
}
}
7 changes: 6 additions & 1 deletion preview/src/ReviewConfig.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
1 change: 0 additions & 1 deletion src/Install/ClauseInCase.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
23 changes: 15 additions & 8 deletions tests/Install/ClauseInCaseTest.elm
Original file line number Diff line number Diff line change
@@ -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" <|
\() ->
Expand All @@ -21,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"
-- }
-- ]
]

0 comments on commit 2b21bac

Please sign in to comment.