diff --git a/README.md b/README.md index 296efd2..e6fc8d3 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ In the following example[2](#nota2), we stub the `rand` function to m (ns greenpowermonitor.test-doubles.stubbing-with-returns-examples (:require [clojure.test :refer [deftest testing is]] - [greenpowermonitor.test-doubles.core :as td])) + [greenpowermonitor.test-doubles :as td])) (deftest stubbing-functions-using-returns (testing "make a function return a given sequence of values in successive calls" @@ -55,7 +55,7 @@ In the following example, we stub the `rand` function so that it always returns (ns greenpowermonitor.test-doubles.stubbing-with-constantly-examples (:require [clojure.test :refer [deftest testing is]] - [greenpowermonitor.test-doubles.core :as td])) + [greenpowermonitor.test-doubles :as td])) (deftest stubbing-functions-using-constantly (testing "make a function return always the same value" @@ -89,7 +89,7 @@ a `nil` will be returned when the received parameters don't match any of the map (ns greenpowermonitor.test-doubles.stubbing-with-maps-examples (:require [clojure.test :refer [deftest testing is]] - [greenpowermonitor.test-doubles.core :as td])) + [greenpowermonitor.test-doubles :as td])) (defn do-some-computation-fn [_ _]) @@ -120,7 +120,7 @@ the calls to each spied function and the arguments passed to them in each call. (ns greenpowermonitor.test-doubles.spying-examples (:require [clojure.test :refer [deftest testing is]] - [greenpowermonitor.test-doubles.core :as td])) + [greenpowermonitor.test-doubles :as td])) (defn- some-function [a b] (println a b)) @@ -155,7 +155,7 @@ In the following example, even though you call the `double-print-x-and-greet` fu (ns greenpowermonitor.test-doubles.stubbing-with-returns-examples (:require [clojure.test :refer [deftest testing is]] - [greenpowermonitor.test-doubles.core :as td])) + [greenpowermonitor.test-doubles :as td])) (defn- greetings-function [] (println "Hola!")) diff --git a/project.clj b/project.clj index 92d876a..33a2ea1 100644 --- a/project.clj +++ b/project.clj @@ -21,6 +21,6 @@ :cljsbuild {:builds [{:id "unit-tests" :source-paths ["src" "test"] :compiler {:output-to "out/unit_tests.js" - :main greenpowermonitor.test-doubles.unit-tests-runner + :main greenpowermonitor.unit-tests-runner :target :nodejs :optimizations :none}}]}) diff --git a/src/greenpowermonitor/test_doubles/core.cljc b/src/greenpowermonitor/test_doubles.cljc similarity index 96% rename from src/greenpowermonitor/test_doubles/core.cljc rename to src/greenpowermonitor/test_doubles.cljc index 276b75f..a62f5be 100644 --- a/src/greenpowermonitor/test_doubles/core.cljc +++ b/src/greenpowermonitor/test_doubles.cljc @@ -1,6 +1,6 @@ -(ns greenpowermonitor.test-doubles.core +(ns greenpowermonitor.test-doubles #?(:cljs (:require-macros - [greenpowermonitor.test-doubles.core]))) + [greenpowermonitor.test-doubles]))) (def ^:dynamic *spies-atom* (atom {})) diff --git a/test/greenpowermonitor/test_doubles/unit_tests_runner.cljs b/test/greenpowermonitor/test_doubles/unit_tests_runner.cljs deleted file mode 100644 index d93bbd7..0000000 --- a/test/greenpowermonitor/test_doubles/unit_tests_runner.cljs +++ /dev/null @@ -1,7 +0,0 @@ -(ns greenpowermonitor.test-doubles.unit-tests-runner - (:require - [doo.runner :refer-macros [doo-tests]] - [greenpowermonitor.test-doubles.core-test])) - -(doo-tests - 'greenpowermonitor.test-doubles.core-test) diff --git a/test/greenpowermonitor/test_doubles/core_test.cljc b/test/greenpowermonitor/test_doubles_test.cljc similarity index 96% rename from test/greenpowermonitor/test_doubles/core_test.cljc rename to test/greenpowermonitor/test_doubles_test.cljc index 433eba3..557836c 100644 --- a/test/greenpowermonitor/test_doubles/core_test.cljc +++ b/test/greenpowermonitor/test_doubles_test.cljc @@ -1,7 +1,7 @@ -(ns greenpowermonitor.test-doubles.core-test +(ns greenpowermonitor.test-doubles-test (:require [clojure.test :refer [deftest is testing]] - [greenpowermonitor.test-doubles.core :as td])) + [greenpowermonitor.test-doubles :as td])) (defn some-function [a b] (println a b)) diff --git a/test/greenpowermonitor/unit_tests_runner.cljs b/test/greenpowermonitor/unit_tests_runner.cljs new file mode 100644 index 0000000..c7b40e7 --- /dev/null +++ b/test/greenpowermonitor/unit_tests_runner.cljs @@ -0,0 +1,7 @@ +(ns greenpowermonitor.unit-tests-runner + (:require + [doo.runner :refer-macros [doo-tests]] + [greenpowermonitor.test-doubles-test])) + +(doo-tests + 'greenpowermonitor.test-doubles-test)