Skip to content

Commit

Permalink
Add fixture for test
Browse files Browse the repository at this point in the history
  • Loading branch information
tarun-nil committed Nov 30, 2023
1 parent 6071fe8 commit 799b5a4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions swift-ticketing/test/swift_ticketing/fixtures.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(ns swift-ticketing.fixtures
(:require
[next.jdbc :as jdbc]
[honey.sql :as sql]
[swift-ticketing.core :refer [create-connection-pool]]
[swift-ticketing.db.ddl :as ddl]
[swift-ticketing.config :refer [read-test-config]]
[swift-ticketing.migrations :as migrations]))

(def test-env
(let [db-config (:database (read-test-config))]
{:db-spec (create-connection-pool db-config)})
)

(defn fixture [tests]
(migrations/migrate-with (:database (read-test-config)))
(tests)
(migrations/rollback-with (:database (read-test-config)))
)

0 comments on commit 799b5a4

Please sign in to comment.