2020-01-14 14:59:56 +03:00
|
|
|
#!/usr/bin/env stack
|
|
|
|
{- stack
|
|
|
|
exec ghci
|
|
|
|
--package pretty-simple
|
2020-01-28 13:37:36 +03:00
|
|
|
--package aeson-pretty
|
2020-01-14 14:59:56 +03:00
|
|
|
--
|
|
|
|
test/Fixtures.hs
|
|
|
|
-}
|
|
|
|
|
|
|
|
{-
|
|
|
|
Stack script that provides a REPL testing environment for Wasp. Includes text fixtures
|
|
|
|
and convenient packages out of the box. Use it when you want to interactively
|
|
|
|
test a piece of your code.
|
|
|
|
Run it either as an executable or with `stack SCRIPT_NAME`.
|
|
|
|
-}
|
|
|
|
|
|
|
|
import Text.Pretty.Simple (pPrint)
|
2020-01-28 13:37:36 +03:00
|
|
|
import Data.Aeson
|
|
|
|
import Data.Aeson.Encode.Pretty
|
|
|
|
import Data.ByteString.Lazy.Char8 as L
|
|
|
|
|
2020-01-14 14:59:56 +03:00
|
|
|
import Fixtures
|
2020-01-28 13:37:36 +03:00
|
|
|
|
|
|
|
-- | Prints any ToJSON instance, useful when testing parser.
|
|
|
|
printJSON :: ToJSON a => a -> IO ()
|
|
|
|
printJSON = L.putStrLn . encodePretty
|