Skip to content

Commit 5799704

Browse files
authored
Fix more issues when using non-composite matchers (m/regex, m/pred, etc) inside match-with (#215)
* fix more `match-with` bugs in CLJS and get CLJS tests green * make cljs tests return exit code
1 parent e1f5035 commit 5799704

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. This
33
change log follows the conventions of
44
[keepachangelog.com](http://keepachangelog.com/).
55

6+
## 3.8.7 / 2023-08-31
7+
- fix more issues when using non-composite matchers (`m/regex`, `m/pred`, etc)
8+
inside `match-with`.
9+
610
## 3.8.6 / 2023-07-18
711
- fix issue when using non-composite matchers (`m/regex`, `m/pred`, etc)
812
inside `match-with`.

bb.edn

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626

2727
test:node
2828
{:doc "run ClojureScript tests via node"
29-
:task (apply clojure "-M:cljs-test compile cli-test" *command-line-args*)}
29+
:task (do (apply clojure "-M:cljs-test compile cli-test" *command-line-args*)
30+
(shell "node ./out/node-tests.js"))}
3031

3132
test:browser
3233
{:doc "run ClojureScript tests in browser at `http://localhost:9158/`"

shadow-cljs.edn

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
:source-paths ["src/clj" "src/cljc" "src/cljs" "test"]
33
:builds {:cli-test {:target :node-test
44
:output-to "out/node-tests.js"
5-
:ns-regexp "-test$"
6-
:autorun true}
5+
:ns-regexp "-test$"}
76
:browser-test {:target :browser-test
87
:test-dir "out/public/js/test"
98
:ns-regexp "-test$"

src/cljc/matcher_combinators/matchers.cljc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(ns matcher-combinators.matchers
2-
(:require #?(:cljs [matcher-combinators.core :as core :refer [Matcher]]
2+
(:require #?(:cljs [matcher-combinators.core :as core :refer [Matcher Regex Value Absent PredMatcher]]
33
:clj [matcher-combinators.core :as core])
44
[clojure.string :as string]
55
[matcher-combinators.utils :as utils])
@@ -224,7 +224,10 @@
224224
(update value :expected match-with-elements overrides)
225225

226226
;; non-nested matcher like `(m/equals 1)` or `(m/regex #"hi")`
227-
(instance? Matcher value)
227+
#?(:clj (instance? Matcher value)
228+
;; TODO: how do you do this in a comprehensive way?
229+
;; `(satisfies? Matcher value)` doesn't seem to work
230+
:cljs (#{Absent PredMatcher Regex Value} (type value)))
228231
value
229232

230233
(map? value)

version.edn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{:major 3
22
:minor 8
3-
:release 6
3+
:release 7
44
#_#_ :qualifier :alpha}

0 commit comments

Comments
 (0)