mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-12-25 02:34:36 +03:00
Add Review.Test.globalError
This commit is contained in:
parent
c7c2335ac2
commit
0c28c148eb
@ -1,7 +1,7 @@
|
||||
module Review.Test exposing
|
||||
( ReviewResult, run, runWithProjectData, runOnModules, runOnModulesWithProjectData
|
||||
, ExpectedError, expectNoErrors, expectErrors, error, atExactly, whenFixed, expectErrorsForModules, expectErrorsForElmJson, expectErrorsForReadme
|
||||
, expectGlobalErrors
|
||||
, expectGlobalErrors, globalError
|
||||
)
|
||||
|
||||
{-| Module that helps you test your rules, using [`elm-test`](https://package.elm-lang.org/packages/elm-explorations/test/latest/).
|
||||
@ -106,7 +106,7 @@ for this module.
|
||||
import Array exposing (Array)
|
||||
import Elm.Syntax.Module as Module
|
||||
import Elm.Syntax.Node as Node
|
||||
import Elm.Syntax.Range exposing (Range)
|
||||
import Elm.Syntax.Range as Range exposing (Range)
|
||||
import Expect exposing (Expectation)
|
||||
import Review.Error as Error
|
||||
import Review.Fix as Fix
|
||||
@ -818,6 +818,16 @@ error input =
|
||||
}
|
||||
|
||||
|
||||
globalError : { message : String, details : List String } -> ExpectedError
|
||||
globalError input =
|
||||
ExpectedError
|
||||
{ message = input.message
|
||||
, details = input.details
|
||||
, under = UnderExactly "" Range.emptyRange
|
||||
, fixedSource = Nothing
|
||||
}
|
||||
|
||||
|
||||
{-| Precise the exact position where the error should be shown to the user. This
|
||||
is only necessary when the `under` field is ambiguous.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user