Update spec-mocha for purescript 0.12

This commit is contained in:
Alexandra DeWit 2018-06-16 15:21:01 +02:00 committed by Oskar Wickström
parent 8c7930e124
commit 955752033a
3 changed files with 26 additions and 30 deletions

View File

@ -15,9 +15,9 @@
"output"
],
"dependencies": {
"purescript-console": "^3.0.0",
"purescript-foldable-traversable": "^3.0.0",
"purescript-exceptions": "^3.0.0",
"purescript-spec": "^2.0.0"
"purescript-console": "^4.0.0",
"purescript-foldable-traversable": "^4.0.0",
"purescript-exceptions": "^4.0.0",
"purescript-spec": "^3.0.0"
}
}

View File

@ -4,39 +4,35 @@ module Test.Spec.Mocha (
) where
import Prelude
import Control.Monad.Aff (Aff, Error, runAff_)
import Control.Monad.Eff (Eff, kind Effect)
import Effect.Aff (Aff, Error, runAff_)
import Effect (Effect)
import Data.Either (either)
import Data.Foldable (traverse_)
import Test.Spec (Spec, Group(..), collect)
foreign import data MOCHA :: Effect
foreign import data MOCHA :: Type
foreign import itAsync
:: forall e
. Boolean
:: Boolean
-> String
-> (Eff e Unit
-> (Error -> Eff e Unit)
-> Eff e Unit)
-> Eff (mocha :: MOCHA | e) Unit
-> (Effect Unit
-> (Error -> Effect Unit)
-> Effect Unit)
-> Effect Unit
foreign import itPending
:: forall e
. String
-> Eff (mocha :: MOCHA | e) Unit
:: String
-> Effect Unit
foreign import describe
:: forall e
. Boolean
:: Boolean
-> String
-> Eff (mocha :: MOCHA | e) Unit
-> Eff (mocha :: MOCHA | e) Unit
-> Effect Unit
-> Effect Unit
registerGroup
:: forall e
. (Group (Aff e Unit))
-> Eff (mocha :: MOCHA | e) Unit
:: Group (Aff Unit)
-> Effect Unit
registerGroup (It only name test) =
itAsync only name cb
where
@ -48,6 +44,6 @@ registerGroup (Describe only name groups) =
runMocha
:: forall e
. Spec e Unit
-> Eff (mocha :: MOCHA | e) Unit
. Spec Unit
-> Effect Unit
runMocha spec = traverse_ registerGroup (collect spec)

View File

@ -1,14 +1,14 @@
module Test.Main where
import Prelude
import Control.Monad.Aff (delay)
import Control.Monad.Eff (Eff)
import Effect.Aff (delay)
import Effect (Effect)
import Data.Time.Duration (Milliseconds(..))
import Test.Spec (SpecEffects, describe, it, pending)
import Test.Spec (describe, it, pending)
import Test.Spec.Assertions (shouldEqual)
import Test.Spec.Mocha (MOCHA, runMocha)
import Test.Spec.Mocha (runMocha)
main :: Eff (SpecEffects (mocha :: MOCHA)) Unit
main :: Effect Unit
main = runMocha do
describe "test" $
describe "nested" do