packages feed

sydtest-wai 0.2.0.1 → 0.2.0.2

raw patch · 4 files changed

+20/−4 lines, 4 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Test.Syd.Wai.Client: instance Test.Syd.Run.IsTest (Test.Syd.Wai.Client.WaiClientM env (Test.Syd.Run.GoldenTest a))
+ Test.Syd.Wai.Client: instance Test.Syd.Run.IsTest (outerArgs -> Test.Syd.Wai.Client.WaiClientM env (Test.Syd.Run.GoldenTest a))
- Test.Syd.Wai: managerSpec :: TestDefM (Manager : outers) inner result -> TestDefM outers inner result
+ Test.Syd.Wai: managerSpec :: TestDefM (Manager ': outers) inner result -> TestDefM outers inner result
- Test.Syd.Wai: waiClientSpec :: Application -> TestDefM (Manager : outers) (WaiClient ()) result -> TestDefM outers oldInner result
+ Test.Syd.Wai: waiClientSpec :: Application -> TestDefM (Manager ': outers) (WaiClient ()) result -> TestDefM outers oldInner result
- Test.Syd.Wai: waiClientSpecWith :: IO Application -> TestDefM (Manager : outers) (WaiClient ()) result -> TestDefM outers oldInner result
+ Test.Syd.Wai: waiClientSpecWith :: IO Application -> TestDefM (Manager ': outers) (WaiClient ()) result -> TestDefM outers oldInner result
- Test.Syd.Wai: waiClientSpecWithSetupFunc :: (Manager -> oldInner -> SetupFunc (Application, env)) -> TestDefM (Manager : outers) (WaiClient env) result -> TestDefM outers oldInner result
+ Test.Syd.Wai: waiClientSpecWithSetupFunc :: (Manager -> oldInner -> SetupFunc (Application, env)) -> TestDefM (Manager ': outers) (WaiClient env) result -> TestDefM outers oldInner result
- Test.Syd.Wai: waiClientSpecWithSetupFunc' :: (Manager -> oldInner -> SetupFunc (Application, env)) -> TestDefM (Manager : outers) (WaiClient env) result -> TestDefM (Manager : outers) oldInner result
+ Test.Syd.Wai: waiClientSpecWithSetupFunc' :: (Manager -> oldInner -> SetupFunc (Application, env)) -> TestDefM (Manager ': outers) (WaiClient env) result -> TestDefM (Manager ': outers) oldInner result
- Test.Syd.Wai.Def: managerSpec :: TestDefM (Manager : outers) inner result -> TestDefM outers inner result
+ Test.Syd.Wai.Def: managerSpec :: TestDefM (Manager ': outers) inner result -> TestDefM outers inner result
- Test.Syd.Wai.Def: waiClientSpec :: Application -> TestDefM (Manager : outers) (WaiClient ()) result -> TestDefM outers oldInner result
+ Test.Syd.Wai.Def: waiClientSpec :: Application -> TestDefM (Manager ': outers) (WaiClient ()) result -> TestDefM outers oldInner result
- Test.Syd.Wai.Def: waiClientSpecWith :: IO Application -> TestDefM (Manager : outers) (WaiClient ()) result -> TestDefM outers oldInner result
+ Test.Syd.Wai.Def: waiClientSpecWith :: IO Application -> TestDefM (Manager ': outers) (WaiClient ()) result -> TestDefM outers oldInner result
- Test.Syd.Wai.Def: waiClientSpecWithSetupFunc :: (Manager -> oldInner -> SetupFunc (Application, env)) -> TestDefM (Manager : outers) (WaiClient env) result -> TestDefM outers oldInner result
+ Test.Syd.Wai.Def: waiClientSpecWithSetupFunc :: (Manager -> oldInner -> SetupFunc (Application, env)) -> TestDefM (Manager ': outers) (WaiClient env) result -> TestDefM outers oldInner result
- Test.Syd.Wai.Def: waiClientSpecWithSetupFunc' :: (Manager -> oldInner -> SetupFunc (Application, env)) -> TestDefM (Manager : outers) (WaiClient env) result -> TestDefM (Manager : outers) oldInner result
+ Test.Syd.Wai.Def: waiClientSpecWithSetupFunc' :: (Manager -> oldInner -> SetupFunc (Application, env)) -> TestDefM (Manager ': outers) (WaiClient env) result -> TestDefM (Manager ': outers) oldInner result

Files

CHANGELOG.md view
@@ -1,5 +1,11 @@ # Changelog +## [0.2.0.2] - 2024-09-26++### Added++* `IsTest` instances for `WaiClientM` tests returning a `GoldenTest`.+ ## [0.2.0.1] - 2023-10-09  ### Added
src/Test/Syd/Wai/Client.hs view
@@ -66,6 +66,16 @@   type Arg2 (outerArgs -> WaiClientM env ()) = WaiClient env   runTest func = runTest (\outerArgs waiClient -> runWaiClientM waiClient (func outerArgs)) +instance IsTest (WaiClientM env (GoldenTest a)) where+  type Arg1 (WaiClientM env (GoldenTest a)) = ()+  type Arg2 (WaiClientM env (GoldenTest a)) = WaiClient env+  runTest func = runTest (\() -> func)++instance IsTest (outerArgs -> WaiClientM env (GoldenTest a)) where+  type Arg1 (outerArgs -> WaiClientM env (GoldenTest a)) = outerArgs+  type Arg2 (outerArgs -> WaiClientM env (GoldenTest a)) = WaiClient env+  runTest func = runTest (\outerArgs waiClient -> runWaiClientM waiClient (func outerArgs))+ -- | For compatibility with @hspec-wai@ type WaiSession st a = WaiClientM st a @@ -104,7 +114,7 @@         pure r  -- | An assertion context, for 'Context', that shows the last request and response-lastRequestResponseContext :: Show respBody => HTTP.Request -> HTTP.Response respBody -> String+lastRequestResponseContext :: (Show respBody) => HTTP.Request -> HTTP.Response respBody -> String lastRequestResponseContext req resp =   unlines     [ "last request:",
src/Test/Syd/Wai/Request.hs view
@@ -86,7 +86,7 @@ -- -- This function is provided for backward compatibility with wai-test but this approach has been made obsolete by the way sydtest does things. -- You should use 'shouldBe' based on the responses that you get from functions like 'get' and 'post' instead.-shouldRespondWith :: HasCallStack => WaiSession st (HTTP.Response LB.ByteString) -> ResponseMatcher -> WaiExpectation st+shouldRespondWith :: (HasCallStack) => WaiSession st (HTTP.Response LB.ByteString) -> ResponseMatcher -> WaiExpectation st shouldRespondWith action ResponseMatcher {..} = do   response <- action   liftIO $
sydtest-wai.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2.+-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack  name:           sydtest-wai-version:        0.2.0.1+version:        0.2.0.2 synopsis:       A wai companion library for sydtest category:       Testing homepage:       https://github.com/NorfairKing/sydtest#readme