Add the visitor in each test

This commit is contained in:
Jeroen Engels 2023-06-02 16:41:18 +02:00
parent a6f7aa7a71
commit 7935afd767

View File

@ -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