test are somehow working
This commit is contained in:
parent
aad3844314
commit
0b01309b43
7 changed files with 51 additions and 16 deletions
|
@ -6,13 +6,14 @@
|
|||
:dependencies [[org.clojure/clojure "1.10.0"]
|
||||
[aero "1.1.6"]
|
||||
[clj-commons/clj-yaml "0.7.106"]]
|
||||
:source-paths ["src/main"]
|
||||
:resource-paths ["resources/main"]
|
||||
:source-paths ["src/main/cljc"
|
||||
"src/main/clj"]
|
||||
:resource-paths ["src/main/resources"]
|
||||
|
||||
:repositories [["snapshots" :clojars]
|
||||
["releases" :clojars]]
|
||||
:deploy-repositories [["snapshots" :clojars]
|
||||
["releases" :clojars]]
|
||||
:profiles {:test {:test-paths ["test/src"]
|
||||
:resource-paths ["test/resources"]
|
||||
:profiles {:test {:test-paths ["src/test/cljc"]
|
||||
:resource-paths ["src/test/resources"]
|
||||
:dependencies [[dda/data-test "0.1.1"]]}})
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
{:source-paths ["src/main/"
|
||||
"src/test"]
|
||||
{:source-paths ["src/main/cljc"
|
||||
"src/main/cljs"
|
||||
"src/test/cljc"]
|
||||
:dependencies [[aero "1.1.6"]
|
||||
[cljsjs/js-yaml "4.0.0-0"]]
|
||||
:builds {:app {:target :node-script
|
||||
:builds {:test {:target :node-test
|
||||
:output-to "target/node-tests.js"
|
||||
:autorun true
|
||||
:repl-pprint true}
|
||||
:app {:target :node-script
|
||||
:output-to "target/k8s-mastodon-bot.js"
|
||||
:main dda.k8s-mastodon-bot.script/hallowelt
|
||||
:main dda.k8s-mastodon-bot.core/main
|
||||
:compiler-options {:optimizations :simple}}}}
|
||||
|
|
21
src/main/cljc/dda/k8s_mastodon_bot/core.cljc
Normal file
21
src/main/cljc/dda/k8s_mastodon_bot/core.cljc
Normal file
|
@ -0,0 +1,21 @@
|
|||
(ns dda.k8s-mastodon-bot.core
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.string :as cs]
|
||||
;;[dda.k8s-mastodon-bot.yaml :as yaml]
|
||||
))
|
||||
|
||||
(s/def ::options (s/* #{"-h"}))
|
||||
(s/def ::config-location (s/? (s/and string?
|
||||
#(not (cs/starts-with? % "-")))))
|
||||
(s/def ::args (s/cat :options ::options
|
||||
:config-location ::config-location))
|
||||
|
||||
(defn main [& args]
|
||||
(let [parsed-args (s/conform ::args args)]
|
||||
(if (= ::s/invalid parsed-args)
|
||||
(do (s/explain ::args args)
|
||||
)
|
||||
(let [{:keys [options config-location]} parsed-args]
|
||||
"hallowelt"
|
||||
))))
|
8
src/main/cljs/dda/k8s_mastodon_bot/yaml.cljs
Normal file
8
src/main/cljs/dda/k8s_mastodon_bot/yaml.cljs
Normal file
|
@ -0,0 +1,8 @@
|
|||
(ns dda.k8s-mastodon-bot.yaml
|
||||
(:require
|
||||
[aero.core :as aero]
|
||||
;;[jsyaml :as yaml]
|
||||
))
|
||||
|
||||
(defn from-string [input]
|
||||
42)
|
|
@ -1,4 +0,0 @@
|
|||
(ns dda.k8s-mastodon-bot.core)
|
||||
|
||||
(defn mytest[]
|
||||
(println "fhasd"))
|
|
@ -1,4 +0,0 @@
|
|||
(ns dda.k8s-mastodon-bot.script)
|
||||
|
||||
(defn hallowelt []
|
||||
42)
|
8
src/test/cljc/dda/k8s_mastodon_bot/yaml_test.cljc
Normal file
8
src/test/cljc/dda/k8s_mastodon_bot/yaml_test.cljc
Normal file
|
@ -0,0 +1,8 @@
|
|||
(ns dda.k8s-mastodon-bot.yaml-test
|
||||
(:require
|
||||
[clojure.test :refer [deftest is testing are]]
|
||||
[dda.k8s-mastodon-bot.yaml :as cut]))
|
||||
|
||||
(deftest should-pars-yaml-string
|
||||
(is (= 43
|
||||
(cut/from-string "hallo: welt"))))
|
Loading…
Reference in a new issue