generated from coulomb/repo-seed
Merged ihp-new generated scaffold into repo. Sets appName to inter-hub, adds Nix flake with IHP inputs, devenv config, and standard IHP project structure. Nix + ihp-new + direnv installed system-wide. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
24 lines
840 B
Haskell
24 lines
840 B
Haskell
module Main where
|
|
|
|
import Test.Hspec
|
|
import IHP.Prelude
|
|
import IHP.ModelSupport
|
|
import IHP.Log.Types
|
|
import System.Environment (lookupEnv)
|
|
|
|
-- Integration tests run with a temporary PostgreSQL database.
|
|
-- The DATABASE_URL env var is set automatically by `nix flake check`.
|
|
-- See: https://ihp.digitallyinduced.com/Guide/testing.html
|
|
main :: IO ()
|
|
main = do
|
|
databaseUrl <- lookupEnv "DATABASE_URL" >>= \case
|
|
Just url -> pure (cs url)
|
|
Nothing -> error "DATABASE_URL not set. Run `devenv up` first or use `nix flake check`."
|
|
logger <- newLogger def { level = Warn }
|
|
withModelContext databaseUrl logger \modelContext -> do
|
|
let ?modelContext = modelContext
|
|
hspec do
|
|
describe "Database" do
|
|
it "can execute a query" do
|
|
sqlExecDiscardResult "SELECT 1" ()
|