mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
Update the fixture repl macro
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7366 GitOrigin-RevId: f34a42c4dfd2dc257ffe39f4a0db12beb2630629
This commit is contained in:
parent
73e333a412
commit
8325c03500
@ -35,6 +35,7 @@ library
|
||||
build-depends:
|
||||
, HUnit
|
||||
, aeson
|
||||
, aeson-pretty
|
||||
, base
|
||||
, bytestring
|
||||
, dc-api
|
||||
|
@ -4,12 +4,14 @@ import Data.List
|
||||
fixtureReplMacro :: String -> IO String
|
||||
fixtureReplMacro module_ = do
|
||||
return $ unlines
|
||||
[ "import Harness.Test.Fixture",
|
||||
[ "import Data.Aeson.Encode.Pretty (encodePretty)",
|
||||
"import Data.ByteString.Lazy.Char8 qualified as BS",
|
||||
"import Harness.Test.Fixture",
|
||||
"import Harness.Logging",
|
||||
"import System.Environment",
|
||||
":m + *SpecHook *" ++ module_,
|
||||
"logger = Logger mempty",
|
||||
"mode <- setupTestingMode",
|
||||
"te <- setupTestEnvironment mode logger",
|
||||
"Right mode <- fmap lookupTestingMode getEnvironment",
|
||||
"te <- setupTestEnvironment mode (Logger $ BS.putStrLn . encodePretty . fromLoggableMessage)",
|
||||
"te",
|
||||
"putStrLn \"Now do: \\\"cleanup <- fixtureRepl <fixture name> te\\\"\""
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user