Skip to content

Commit

Permalink
Fix more issues when using non-composite matchers (m/regex, `m/pred…
Browse files Browse the repository at this point in the history
…`, etc) inside `match-with` (#215)

* fix more `match-with` bugs in CLJS and get CLJS tests green
* make cljs tests return exit code
  • Loading branch information
philomates authored Sep 1, 2023
1 parent e1f5035 commit 5799704
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. This
change log follows the conventions of
[keepachangelog.com](http://keepachangelog.com/).

## 3.8.7 / 2023-08-31
- fix more issues when using non-composite matchers (`m/regex`, `m/pred`, etc)
inside `match-with`.

## 3.8.6 / 2023-07-18
- fix issue when using non-composite matchers (`m/regex`, `m/pred`, etc)
inside `match-with`.
Expand Down
3 changes: 2 additions & 1 deletion bb.edn
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

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

test:browser
{:doc "run ClojureScript tests in browser at `http://localhost:9158/`"
Expand Down
3 changes: 1 addition & 2 deletions shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
:source-paths ["src/clj" "src/cljc" "src/cljs" "test"]
:builds {:cli-test {:target :node-test
:output-to "out/node-tests.js"
:ns-regexp "-test$"
:autorun true}
:ns-regexp "-test$"}
:browser-test {:target :browser-test
:test-dir "out/public/js/test"
:ns-regexp "-test$"
Expand Down
7 changes: 5 additions & 2 deletions src/cljc/matcher_combinators/matchers.cljc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns matcher-combinators.matchers
(:require #?(:cljs [matcher-combinators.core :as core :refer [Matcher]]
(:require #?(:cljs [matcher-combinators.core :as core :refer [Matcher Regex Value Absent PredMatcher]]
:clj [matcher-combinators.core :as core])
[clojure.string :as string]
[matcher-combinators.utils :as utils])
Expand Down Expand Up @@ -224,7 +224,10 @@
(update value :expected match-with-elements overrides)

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

(map? value)
Expand Down
2 changes: 1 addition & 1 deletion version.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{:major 3
:minor 8
:release 6
:release 7
#_#_ :qualifier :alpha}

0 comments on commit 5799704

Please sign in to comment.