Validate valid inputs
This commit is contained in:
parent
85f9b3285a
commit
e69d99b7f3
3 changed files with 19 additions and 0 deletions
19
src/test/cljc/dda/c4k_shynet/core_test.cljc
Normal file
19
src/test/cljc/dda/c4k_shynet/core_test.cljc
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
(ns dda.c4k-shynet.core-test
|
||||||
|
(:require
|
||||||
|
#?(:clj [clojure.test :refer [deftest is are testing run-tests]]
|
||||||
|
:cljs [cljs.test :refer-macros [deftest is are testing run-tests]])
|
||||||
|
#?(:cljs [shadow.resource :as rc])
|
||||||
|
[clojure.spec.alpha :as s]
|
||||||
|
[dda.c4k-common.yaml :as yaml]
|
||||||
|
[dda.c4k-shynet.core :as cut]))
|
||||||
|
|
||||||
|
#?(:cljs
|
||||||
|
(defmethod yaml/load-resource :jitsi-test [resource-name]
|
||||||
|
(case resource-name
|
||||||
|
"valid-auth.yaml" (rc/inline "valid-auth.yaml")
|
||||||
|
"valid-config.yaml" (rc/inline "valid-config.yaml")
|
||||||
|
(throw (js/Error. "Undefined Resource!")))))
|
||||||
|
|
||||||
|
(deftest validate-valid-resources
|
||||||
|
(is (s/valid? cut/config? (yaml/load-as-edn "valid-config.yaml")))
|
||||||
|
(is (s/valid? cut/auth? (yaml/load-as-edn "valid-auth.yaml"))))
|
Loading…
Reference in a new issue