jfmengels/elm-lint/2.0.1

NOTE: this package is not compatible with Elm 0.19.1

Lint.Rules.ElmTest.NoDuplicateTestBodies

rule : LintRule

Forbid dupicate test bodies. When copy-pasting tests, it can happen that the title is changed but the developer forgets to update the test body. This may result in specifications that are thought to be implemented but are not enforced by tests.

rules =
    [ ElmTest.NoDuplicateTestBodies.rule
    ]

Fail

module Addition exposing (..)


import Test exposing (test)


tests =
    [ test "foo" <|
        \() -> 1 + 1
            |> Expect.equal 2
    , test "bar" <|
        \() -> 1 + 1
            |> Expect.equal 2
    ]

Success

module Addition exposing (..)


import Test exposing (test)


tests =
    [ test "foo" <|
        \() -> 1 + 1
            |> Expect.equal 2
    , test "bar" <|
        \() -> 1 + 2
            |> Expect.equal 3
    ]