summaryrefslogtreecommitdiff
path: root/Biz/Test.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2024-04-08 10:06:38 -0400
committerBen Sima <ben@bsima.me>2024-04-09 22:13:59 -0400
commitc43acccbabc02464a6b02bd191199dd0ccd47b52 (patch)
treed022a7d10cdc800816d354ba1f6906177edd125f /Biz/Test.hs
parent11d95581fb178a5d21e88dfd8030a61886cc2519 (diff)
Skip tests that require network
This started failing recently, I think because my key expired or something. Anyway I shouldn't be doing network requests in unit tests. So until I figure out how to design a test suite that can handle network requests in a sensible way, just skip these tests.
Diffstat (limited to 'Biz/Test.hs')
-rw-r--r--Biz/Test.hs14
1 files changed, 10 insertions, 4 deletions
diff --git a/Biz/Test.hs b/Biz/Test.hs
index 0a2cf2f..508703b 100644
--- a/Biz/Test.hs
+++ b/Biz/Test.hs
@@ -2,6 +2,8 @@
module Biz.Test
( Tree,
+ Description,
+ Assertion,
run,
group,
none,
@@ -24,6 +26,10 @@ import qualified Test.Tasty.Runners as Tasty
type Tree = Tasty.TestTree
+type Description = Tasty.TestName
+
+type Assertion = HUnit.Assertion
+
run :: Tree -> IO ()
run tree = do
Tasty.installSignalHandlers
@@ -33,16 +39,16 @@ run tree = do
exitFailure
Just act -> act +> \ok -> if ok then exitSuccess else exitFailure
-group :: Tasty.TestName -> [Tasty.TestTree] -> Tasty.TestTree
+group :: Description -> [Tasty.TestTree] -> Tree
group = Tasty.testGroup
-unit :: Tasty.TestName -> HUnit.Assertion -> Tasty.TestTree
+unit :: Description -> Assertion -> Tree
unit = HUnit.testCase
-prop :: QuickCheck.Testable a => Tasty.TestName -> a -> Tasty.TestTree
+prop :: QuickCheck.Testable a => Description -> a -> Tree
prop = QuickCheck.testProperty
-assertFailure :: String -> HUnit.Assertion
+assertFailure :: String -> Assertion
assertFailure = HUnit.assertFailure
with ::