Support comparing native JS objects in CLJS
Open
- Dominant language
- Clojure
- Stars
- 60
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Two JS objects or arrays with `=?` contents should be `=?`.
Deep comparison on JS objects is intractable, but we can support the obvious cases of vanilla objects and arrays. If the constructor on either side is something else (like a custom class) then it can be always `false`.
```clojure
;; I want to write this.
(deftest slick-test
(is (=? #js {:abc 7, :xyz {:some "Clojure map"}}
(a-function 7))))
;; Instead I have to write this.
(deftest clunky-test
(let [js-blob (a-function 7)]
(is (=? 7 (.-abc js-blob)))
(is (=? {:some "Clojure map"} (.-xyz js-blob)))))
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.