@@ -1,41 +0,0 @@
1−module Test.Spec.Mocha (
2− runMocha,
3− MOCHA()
4− ) where
5−
6−import Prelude
7−
8−import Control.Monad.Aff (Aff())
9−import Control.Monad.Eff (kind Effect, Eff())
10−
11−import Data.Foldable (traverse_)
12−
13−import Test.Spec (Spec, Group(..), collect)
14−
15−foreign import data MOCHA :: Effect
16−
17−foreign import itAsync :: forall e.
18− Boolean
19− -> String
20− -> Aff e Unit
21− -> Eff (mocha :: MOCHA | e) Unit
22−
23−foreign import itPending :: forall e. String
24− -> Eff (mocha :: MOCHA | e) Unit
25−
26−foreign import describe :: forall e.
27− Boolean
28− -> String
29− -> Eff (mocha :: MOCHA | e) Unit
30− -> Eff (mocha :: MOCHA | e) Unit
31−
32−registerGroup :: forall e. (Group (Aff e Unit))
33− -> Eff (mocha :: MOCHA | e) Unit
34−registerGroup (It only name test) = itAsync only name test
35−registerGroup (Pending name) = itPending name
36−registerGroup (Describe only name groups) =
37− describe only name (traverse_ registerGroup groups)
38−
39−runMocha :: forall e. Spec e Unit
40− -> Eff (mocha :: MOCHA | e) Unit
41−runMocha spec = traverse_ registerGroup (collect spec)