2015-07-27 20:41:57 +03:00
|
|
|
module Test.Main where
|
|
|
|
|
|
|
|
import Prelude
|
2018-06-16 16:21:01 +03:00
|
|
|
import Effect.Aff (delay)
|
|
|
|
import Effect (Effect)
|
2017-10-04 09:00:29 +03:00
|
|
|
import Data.Time.Duration (Milliseconds(..))
|
2018-06-16 16:21:01 +03:00
|
|
|
import Test.Spec (describe, it, pending)
|
2016-10-23 19:41:01 +03:00
|
|
|
import Test.Spec.Assertions (shouldEqual)
|
2018-06-16 16:21:01 +03:00
|
|
|
import Test.Spec.Mocha (runMocha)
|
2015-07-27 20:41:57 +03:00
|
|
|
|
2018-06-16 16:21:01 +03:00
|
|
|
main :: Effect Unit
|
2016-10-23 19:41:01 +03:00
|
|
|
main = runMocha do
|
2015-07-27 20:41:57 +03:00
|
|
|
describe "test" $
|
|
|
|
describe "nested" do
|
|
|
|
it "works" $
|
|
|
|
(1 + 1) `shouldEqual` 2
|
|
|
|
pending "is pending"
|
|
|
|
|
|
|
|
describe "test" $
|
|
|
|
describe "other" do
|
|
|
|
it "breaks" $ 1 `shouldEqual` 2
|
2016-10-23 19:41:01 +03:00
|
|
|
|
|
|
|
describe "async" do
|
|
|
|
it "works" $ do
|
2017-10-04 09:00:29 +03:00
|
|
|
expected <- do
|
|
|
|
delay (Milliseconds 1.0)
|
|
|
|
pure 2
|
2016-10-23 19:41:01 +03:00
|
|
|
(1 + 1) `shouldEqual` expected
|
|
|
|
it "and can fail" do
|
2017-10-04 09:00:29 +03:00
|
|
|
expected <- do
|
|
|
|
delay (Milliseconds 1.0)
|
|
|
|
pure 3
|
2016-10-23 19:41:01 +03:00
|
|
|
(1 + 1) `shouldEqual` expected
|