Lein test
runs my functions in random order.
I have two functions that modify the same data. I need the first one running first and the second one after that. The order in my test firles
Example:
;;===============my file=============
;;this fails if x and y are not found.
(defn create-data [x y]
(go add x y))
;;if the update function doesn't find x and y it adds them so create-data fails when it runs after update-data
(defn update-data [x y]
(go update x y))
;;======my file test=======
(deftest create-test
(testing "this should run first"
(is (= 20 create-data)))
(deftest create-test
(testing "this should run second"
(is (= 20 update-data)))
so I thought creating one test for both functions will make it work but it doesn't.
(deftest test-create-update.
(testing "this should run second"
(is (= 20 create-data))
(is (= 20 update-data)))
I want something that will run both functions but will run create-data first for sure and regardless of the result (whether passed or failed) will run the update-data. I need both in my test. Individually they work. but i need automated testing.