import Data.Text.Lazy (Text) import qualified Data.Text.Lazy as L import Lucid import Test.Hspec {-# ANN module ("HLint: ignore Redundant do" :: String) #-} value1 :: Text value1 = "value1" demoPage :: IO Text demoPage = return $ renderText $ do head_ (title_ "recent calls") body_ $ table_ $ do tr_ $ do th_ "field1" th_ "field2" th_ "field3" tr_ $ do td_ (toHtml value1) td_ "value2" td_ "value3" main :: IO () main = hspec $ do describe "demoPage" $ do it "should work" $ do text <- demoPage text `shouldBe` L.pack "recent calls
field1field2field3
value1value2value3
"