generated from coulomb/repo-seed
feat(T01): bootstrap IHP v1.5 project scaffold
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>
This commit is contained in:
23
Test/Integration.hs
Normal file
23
Test/Integration.hs
Normal file
@@ -0,0 +1,23 @@
|
||||
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" ()
|
||||
Reference in New Issue
Block a user