Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no stacktrace & test abort in phantomjs #59

Open
laurentsenta opened this issue Apr 7, 2017 · 2 comments
Open

no stacktrace & test abort in phantomjs #59

laurentsenta opened this issue Apr 7, 2017 · 2 comments

Comments

@laurentsenta
Copy link

Hi again, I have another problem, using phantomjs:

With the same setup that in #58 but without :js-env option, I get

  • an error with no stack-trace nor info on where to look for
  • the test runner seem's to abort, I have half a dozen namespaces that do not show up.

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
Copy link

👍 running into the same issue and it makes it difficult to debug failing tests

@thedavidmeister
Copy link
Collaborator

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)))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants