Add test for transform
java.lang.ClassCastException
When `obj` argument is a string (X)HTML payload and not a string URL or URI, the following exception is thrown: ```clojure java.lang.ClassCastException: class java.lang.Class cannot be cast to class clojure.lang.IFn ```
This commit is contained in:
parent
ebd6230bdb
commit
4aa6bf978f
13
test/html_to_md/transformer_test.clj
Normal file
13
test/html_to_md/transformer_test.clj
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
(ns html-to-md.transformer-test
|
||||||
|
(:require
|
||||||
|
[clojure.string :as str]
|
||||||
|
[clojure.test :as t :refer [deftest is testing]]
|
||||||
|
[html-to-md.html-to-md :refer [markdown-dispatcher]]
|
||||||
|
[html-to-md.transformer :refer [transform]]))
|
||||||
|
|
||||||
|
(deftest transform-payload
|
||||||
|
(testing "String `obj` for: 3. A string representation of an (X)HTML fragment;"
|
||||||
|
(is (= "# This is a header"
|
||||||
|
(str/trim (-> "<h1>This is a header"
|
||||||
|
(transform markdown-dispatcher)
|
||||||
|
(first)))))))
|
Loading…
Reference in a new issue