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"
354
354
(fn []
355
355
(try
356
356
(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))
357
360
; ; REPLs don't normally load cljs_deps.js
358
361
(when (and coptsf (.exists coptsf))
359
362
(let [depsf (io/file (:output-dir opts) " cljs_deps.js" )]
Original file line number Diff line number Diff line change 4
4
[clojure.java.io :as io]
5
5
[clojure.java.shell :as shell :refer [with-sh-dir]]
6
6
[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]]
8
8
[clojure.string :as string]))
9
9
10
10
(deftest eval-test
127
127
(with-repl-env-filter #{" graaljs" }
128
128
(-> (cljs-main " -e" " (.eval js/Polyglot \" js\" \" 1+1\" )" )
129
129
(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 102
102
(is (= (string/trim (apply str (map print-str (interleave expected-lines (repeat " \n " )))))
103
103
(string/trim (:out result))))))
104
104
105
+ (defn check-result [result pred]
106
+ (when-not (:repl-env-filtered result)
107
+ (pred result)))
108
+
105
109
(defn repl-title []
106
110
(string/trim (with-out-str (repl/repl-title ))))
You can’t perform that action at this time.
0 commit comments