mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-29 01:24:35 +03:00
Add test
This commit is contained in:
parent
db85181f6a
commit
6a9fe48b1f
@ -34,6 +34,27 @@ import Html.Attributes as Attr
|
|||||||
|
|
||||||
view model =
|
view model =
|
||||||
Html.span [ Attr.class "unknown" ] []
|
Html.span [ Attr.class "unknown" ] []
|
||||||
|
"""
|
||||||
|
|> Review.Test.runWithProjectData projectWithCssClasses
|
||||||
|
(cssFiles [ FilePattern.include "*.css" ] |> rule)
|
||||||
|
|> Review.Test.expectErrorsForExtraFile "some-file.css"
|
||||||
|
[ Review.Test.error
|
||||||
|
{ message = "Found unused CSS classes"
|
||||||
|
, details =
|
||||||
|
[ "This file declared the usage of some CSS classes for which I could not any usage in the Elm codebase. Please check that no typo was made in the name of the classes, and remove them if they still seem unused."
|
||||||
|
, "Here are the classes that seem unused: unused"
|
||||||
|
]
|
||||||
|
, under = "-- First line"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
, test "should not report an error when all CSS classes are used" <|
|
||||||
|
\() ->
|
||||||
|
"""module A exposing (..)
|
||||||
|
import Html
|
||||||
|
import Html.Attributes as Attr
|
||||||
|
|
||||||
|
view model =
|
||||||
|
Html.span [ Attr.class "unused" ] []
|
||||||
"""
|
"""
|
||||||
|> Review.Test.runWithProjectData projectWithCssClasses
|
|> Review.Test.runWithProjectData projectWithCssClasses
|
||||||
(cssFiles [ FilePattern.include "*.css" ] |> rule)
|
(cssFiles [ FilePattern.include "*.css" ] |> rule)
|
||||||
|
Loading…
Reference in New Issue
Block a user