mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-09-11 16:16:09 +03:00
Add the visitor in each test
This commit is contained in:
parent
a6f7aa7a71
commit
7935afd767
@ -17,6 +17,10 @@ all =
|
||||
createProject
|
||||
[ { path = "foo/some-file.css", content = "#thing { color: red; }" }
|
||||
]
|
||||
|
||||
rule : Rule
|
||||
rule =
|
||||
createRule (Rule.withArbitraryFilesModuleVisitor [ "foo/some-file.css" ] arbitraryFilesModuleVisitor)
|
||||
in
|
||||
"""module A exposing (a)
|
||||
a = 1
|
||||
@ -37,6 +41,10 @@ a = 1
|
||||
, { path = "foo/some-other-file.css", content = "#thing { color: red; }" }
|
||||
, { path = "bar/some-file.css", content = "#thing { color: red; }" }
|
||||
]
|
||||
|
||||
rule : Rule
|
||||
rule =
|
||||
createRule (Rule.withArbitraryFilesModuleVisitor [ "foo/some-file.css" ] arbitraryFilesModuleVisitor)
|
||||
in
|
||||
"""module A exposing (a)
|
||||
a = 1
|
||||
@ -54,10 +62,10 @@ type alias Context =
|
||||
List String
|
||||
|
||||
|
||||
rule : Rule
|
||||
rule =
|
||||
createRule : (Rule.ModuleRuleSchema { canCollectProjectData : () } (List a) -> Rule.ModuleRuleSchema schemaState Context) -> Rule
|
||||
createRule modifier =
|
||||
Rule.newModuleRuleSchema "WithCommentsVisitorTestRule" []
|
||||
|> Rule.withArbitraryFilesModuleVisitor [ "foo/some-file.css" ] arbitraryFilesModuleVisitor
|
||||
|> modifier
|
||||
|> Rule.withModuleDefinitionVisitor (\_ context -> ( [], context ))
|
||||
|> Rule.withFinalModuleEvaluation finalEvaluation
|
||||
|> Rule.fromModuleRuleSchema
|
||||
|
Loading…
Reference in New Issue
Block a user