mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +03:00
52317930fe
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7738 GitOrigin-RevId: 1576bfb51b20cdc8a67924533e4da03ec2f1f3af
21 lines
687 B
Plaintext
21 lines
687 B
Plaintext
import Data.List qualified as List
|
|
|
|
:{
|
|
fixtureReplMacro :: String -> IO String
|
|
fixtureReplMacro module_ = do
|
|
return $ List.unlines
|
|
[ "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_,
|
|
"Right mode <- fmap lookupTestingMode getEnvironment",
|
|
"te <- setupTestEnvironment mode (Logger $ BS.putStrLn . encodePretty . fromLoggableMessage)",
|
|
"te",
|
|
"putStrLn \"Now do: \\\"cleanup <- fixtureRepl <fixture name> te\\\"\""
|
|
]
|
|
:}
|
|
|
|
:def fixtureRepl fixtureReplMacro
|