From 955752033aeaafc5e42bd10607f06612fd645dff Mon Sep 17 00:00:00 2001 From: Alexandra DeWit Date: Sat, 16 Jun 2018 15:21:01 +0200 Subject: [PATCH] Update spec-mocha for purescript 0.12 --- bower.json | 8 ++++---- src/Test/Spec/Mocha.purs | 38 +++++++++++++++++--------------------- test/Main.purs | 10 +++++----- 3 files changed, 26 insertions(+), 30 deletions(-) diff --git a/bower.json b/bower.json index f4b9da3..f1482da 100644 --- a/bower.json +++ b/bower.json @@ -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" } } diff --git a/src/Test/Spec/Mocha.purs b/src/Test/Spec/Mocha.purs index 2b96807..26a1215 100644 --- a/src/Test/Spec/Mocha.purs +++ b/src/Test/Spec/Mocha.purs @@ -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) diff --git a/test/Main.purs b/test/Main.purs index 9cc5b73..9cf75b3 100644 --- a/test/Main.purs +++ b/test/Main.purs @@ -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