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:
|
build-depends:
|
||||||
, HUnit
|
, HUnit
|
||||||
, aeson
|
, aeson
|
||||||
|
, aeson-pretty
|
||||||
, base
|
, base
|
||||||
, bytestring
|
, bytestring
|
||||||
, dc-api
|
, dc-api
|
||||||
|
@ -4,12 +4,14 @@ import Data.List
|
|||||||
fixtureReplMacro :: String -> IO String
|
fixtureReplMacro :: String -> IO String
|
||||||
fixtureReplMacro module_ = do
|
fixtureReplMacro module_ = do
|
||||||
return $ unlines
|
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 Harness.Logging",
|
||||||
|
"import System.Environment",
|
||||||
":m + *SpecHook *" ++ module_,
|
":m + *SpecHook *" ++ module_,
|
||||||
"logger = Logger mempty",
|
"Right mode <- fmap lookupTestingMode getEnvironment",
|
||||||
"mode <- setupTestingMode",
|
"te <- setupTestEnvironment mode (Logger $ BS.putStrLn . encodePretty . fromLoggableMessage)",
|
||||||
"te <- setupTestEnvironment mode logger",
|
|
||||||
"te",
|
"te",
|
||||||
"putStrLn \"Now do: \\\"cleanup <- fixtureRepl <fixture name> te\\\"\""
|
"putStrLn \"Now do: \\\"cleanup <- fixtureRepl <fixture name> te\\\"\""
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user