Skip to content

Commit

Permalink
make next jdbc tests less fragile when doing tests in different orders
Browse files Browse the repository at this point in the history
  • Loading branch information
csummers committed Jul 30, 2023
1 parent 35e40e7 commit 5b8edf5
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
3))))

(deftest custom-builder-fn-test
(hugsql/set-adapter! (next-jdbc/hugsql-adapter-next-jdbc {:builder-fn result-set/as-unqualified-maps}))
(sql/create-colors-table db)
(testing "select a row w/ custom builder fn"
(is (= (:color/id (sql/select-color-by-id db {:id 1}))
1))))
(let [adapter (next-jdbc/hugsql-adapter-next-jdbc {:builder-fn result-set/as-unqualified-maps})]
(sql/create-colors-table db {} {:adapter adapter})
(testing "select a row w/ custom builder fn"
(is (= (:color/id (sql/select-color-by-id db {:id 1} {:adapter adapter}))
1)))))

0 comments on commit 5b8edf5

Please sign in to comment.