From c21fbff07e8ce28c42903d4875805d7f3987c7d1 Mon Sep 17 00:00:00 2001 From: Jeroen Engels Date: Mon, 13 Jan 2020 17:17:50 +0100 Subject: [PATCH] NoUnusedExports: Don't report used functions or values --- tests/NoUnusedExportsTest.elm | 55 ++++++++++++++++------------------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/tests/NoUnusedExportsTest.elm b/tests/NoUnusedExportsTest.elm index 185fa850..631f19d2 100644 --- a/tests/NoUnusedExportsTest.elm +++ b/tests/NoUnusedExportsTest.elm @@ -81,10 +81,9 @@ a = 1 } |> Review.Test.atExactly { start = { row = 2, column = 20 }, end = { row = 2, column = 21 } } ] - , Test.skip <| - test "should not report an exposed function when it is used in other modules (qualified import)" <| - \() -> - [ """ + , test "should not report an exposed function when it is used in other modules (qualified import)" <| + \() -> + [ """ module A exposing (a) a = 1 """, """ @@ -92,12 +91,11 @@ module B exposing (main) import A main = A.a """ ] - |> Review.Test.runOnModulesWithProjectData application rule - |> Review.Test.expectNoErrors - , Test.skip <| - test "should not report an exposed function when it is used in other modules (using an alias)" <| - \() -> - [ """ + |> Review.Test.runOnModulesWithProjectData application rule + |> Review.Test.expectNoErrors + , test "should not report an exposed function when it is used in other modules (using an alias)" <| + \() -> + [ """ module A exposing (a) a = 1 """, """ @@ -105,12 +103,11 @@ module B exposing (main) import A as SomeA main = SomeA.a """ ] - |> Review.Test.runOnModulesWithProjectData application rule - |> Review.Test.expectNoErrors - , Test.skip <| - test "should not report an exposed function when it is used in other modules (using `exposing` to import)" <| - \() -> - [ """ + |> Review.Test.runOnModulesWithProjectData application rule + |> Review.Test.expectNoErrors + , test "should not report an exposed function when it is used in other modules (using `exposing` to import)" <| + \() -> + [ """ module A exposing (a) a = 1 """, """ @@ -118,12 +115,11 @@ module B exposing (main) import A exposing (a) main = a """ ] - |> Review.Test.runOnModulesWithProjectData application rule - |> Review.Test.expectNoErrors - , Test.skip <| - test "should not report an exposed function when it is used in other modules (using `exposing(..)` to import)" <| - \() -> - [ """ + |> Review.Test.runOnModulesWithProjectData application rule + |> Review.Test.expectNoErrors + , test "should not report an exposed function when it is used in other modules (using `exposing(..)` to import)" <| + \() -> + [ """ module A exposing (a) a = 1 """, """ @@ -131,8 +127,8 @@ module B exposing (main) import A exposing (..) main = a """ ] - |> Review.Test.runOnModulesWithProjectData application rule - |> Review.Test.expectNoErrors + |> Review.Test.runOnModulesWithProjectData application rule + |> Review.Test.expectNoErrors , test "should report an exposed function when it is not used in other modules, even if it is used in the module" <| \() -> """ @@ -149,15 +145,14 @@ main = exposed } |> Review.Test.atExactly { start = { row = 2, column = 20 }, end = { row = 2, column = 27 } } ] - , Test.skip <| - test "should not report anything for modules that expose everything`" <| - \() -> - """ + , test "should not report anything for modules that expose everything`" <| + \() -> + """ module A exposing (..) a = 1 """ - |> Review.Test.runWithProjectData package_ rule - |> Review.Test.expectNoErrors + |> Review.Test.runWithProjectData package_ rule + |> Review.Test.expectNoErrors , test "should not report the `main` function for an application even if it is unused" <| \() -> """