crisptrutski / boot-cljs-test

Boot task to run ClojureScript tests.
53 stars 18 forks source link

no stacktrace & test abort in phantomjs #59

Open laurentsenta opened 7 years ago

laurentsenta commented 7 years ago

Hi again, I have another problem, using phantomjs:

With the same setup that in https://github.com/crisptrutski/boot-cljs-test/issues/58 but without :js-env option, I get

Here's the output:

;; ======================================================================
;; Testing with Phantom:

Testing frontend.storage-test

Testing budb.cljs.firebase-store-test
DEBUG [frontend.firebase.core:36] - Loading Firebase with {:apiKey "...", :authDomain "....", :databaseURL "....", :storageBucket "...", :messagingSenderId "..."}
Error: No protocol method IDeref.-deref defined for type null:

  phantomjs://code/phantom8974099379113651456.js:81 in onError
Compiling ClojureScript...
• cljs_test/generated_test_suite.js
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: clojure.tools.analyzer.utils, being replaced by: #'clojure.tools.analyzer.utils/boolean?
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/boolean?
WARNING: -dissoc already refers to: cljs.core/-dissoc being replaced by: konserve.protocols/-dissoc at line 3 /Users/laurent/.boot/cache/tmp/Users/laurent/dev/proj/proj-frontend/re3/-lhed9a/cljs_test/generated_test_suite.out/konserve/protocols.cljc
Compiling {sass}... 17 changed files.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Elapsed time: 92.873 sec

I rely a lot on core.async and async tests, could this be an issue? Thanks again for taking a look,

Samstiles commented 7 years ago

:+1: running into the same issue and it makes it difficult to debug failing tests

thedavidmeister commented 6 years ago

This is helping me get at stack traces in tests

(ns stack-trace.api
 (:require
  clojure.string))

(defn print-phantom-trace
 [trace]
 (let [process-line (fn [s] (clojure.string/replace s #"file:.*generated_test_suite\.out" " ... "))]
  (doseq [l (map process-line (clojure.string/split-lines trace))]
   (prn l))))

(defn trace-pred
 [pred]
 (try
  (when-not (pred)
   (throw (js/Error. "fail")))
  (catch js/Error e
   (print-phantom-trace (.-stack e)))))