mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-09-20 04:27:25 +03:00
Add Review.Test.globalError
This commit is contained in:
parent
c7c2335ac2
commit
0c28c148eb
@ -1,7 +1,7 @@
|
|||||||
module Review.Test exposing
|
module Review.Test exposing
|
||||||
( ReviewResult, run, runWithProjectData, runOnModules, runOnModulesWithProjectData
|
( ReviewResult, run, runWithProjectData, runOnModules, runOnModulesWithProjectData
|
||||||
, ExpectedError, expectNoErrors, expectErrors, error, atExactly, whenFixed, expectErrorsForModules, expectErrorsForElmJson, expectErrorsForReadme
|
, 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/).
|
{-| 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 Array exposing (Array)
|
||||||
import Elm.Syntax.Module as Module
|
import Elm.Syntax.Module as Module
|
||||||
import Elm.Syntax.Node as Node
|
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 Expect exposing (Expectation)
|
||||||
import Review.Error as Error
|
import Review.Error as Error
|
||||||
import Review.Fix as Fix
|
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
|
{-| Precise the exact position where the error should be shown to the user. This
|
||||||
is only necessary when the `under` field is ambiguous.
|
is only necessary when the `under` field is ambiguous.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user