File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,9 @@ present"
354354 (fn []
355355 (try
356356 (repl/setup renv repl/*repl-opts*)
357+ ; ; Load cljs.repl runtime (so ex-str, ex-triage, etc. are available)
358+ (repl/evaluate-form renv (ana-api/empty-env ) " <cljs repl>"
359+ `(~'require ~''cljs.repl))
357360 ; ; REPLs don't normally load cljs_deps.js
358361 (when (and coptsf (.exists coptsf))
359362 (let [depsf (io/file (:output-dir opts) " cljs_deps.js" )]
Original file line number Diff line number Diff line change 44 [clojure.java.io :as io]
55 [clojure.java.shell :as shell :refer [with-sh-dir]]
66 [clojure.string :as str]
7- [cljs-cli.util :refer [cljs-main output-is with-sources with-in with-post-condition with-repl-env-filter repl-title]]
7+ [cljs-cli.util :refer [cljs-main output-is check-result with-sources with-in with-post-condition with-repl-env-filter repl-title]]
88 [clojure.string :as string]))
99
1010(deftest eval-test
127127 (with-repl-env-filter #{" graaljs" }
128128 (-> (cljs-main " -e" " (.eval js/Polyglot \" js\" \" 1+1\" )" )
129129 (output-is 2 ))))
130+
131+ (deftest test-cljs-3043
132+ (with-repl-env-filter (complement #{" rhino" })
133+ (let [check-fn (fn [result]
134+ (is (= 1 (:exit result)))
135+ (is (str/includes? (:err result) " Execution error" ))
136+ (is (not (str/includes? (:err result) " error__GT_str" ))))]
137+ (-> (cljs-main
138+ " -e" " js/foo" )
139+ (check-result check-fn))
140+ (with-sources {" src/foo/core.cljs"
141+ " (ns foo.core) (prn js/bogus)" }
142+ (-> (cljs-main " -m" " foo.core" )
143+ (check-result check-fn)))
144+ (with-sources {" src/foo/core.cljs"
145+ " (ns foo.core) (prn js/bogus)" }
146+ (-> (cljs-main " src/foo/core.cljs" )
147+ (check-result check-fn))))))
Original file line number Diff line number Diff line change 102102 (is (= (string/trim (apply str (map print-str (interleave expected-lines (repeat " \n " )))))
103103 (string/trim (:out result))))))
104104
105+ (defn check-result [result pred]
106+ (when-not (:repl-env-filtered result)
107+ (pred result)))
108+
105109(defn repl-title []
106110 (string/trim (with-out-str (repl/repl-title ))))
You can’t perform that action at this time.
0 commit comments