Fork me on GitHub

I’ve been using cljs.spec.alpha a bit, and it seems that exceptions thrown from cljs.spec.test.alpha/instrument never include file, line number or column number. Does anyone know why, and/or how to fix?


I use fdef and instrument, and when argument specs fail, I get exceptions with empty file name and line numbers, making it hard to locate the origin of the problem


@dnolen bhb/expound works nicely, however I realize I have another issue... the Error objects being thrown by spec are wrapping the actual error message


interestingly, this illustrates the <filename missing> that I was asking about just a few hours ago 🙂


two birds 🐦


There is some cljs api to compile a clojure string to a javascript string? (cljs/str-build {:src "(prn \"hello\")"}) ;; => {:output "console.log(\"hello\")"}


after long hiatus I'm doing some more serious clojurescript and have problems setting up the tests to produce reasonable feedback so some newbie questions ahead. * right now I'm "discovering" that (is ...) seems to swallow exception stack trace by design. Am I missing something? I have big problem figuring out which of the assertions in the production code failed * none of the testing tools seems to have the full picture when it comes to reporting, so I'm running doo and devcards in parallel to have reasonable insight what's failing


@ramblurr you can do a custom reporter for your tests


@gdanov you should always get the name of the test that failed


@christian767 there was some rudimentary work to do what Clojure does but this probably needs more work, look at the source of instrument if you want to help out here

Roger Roberts14:05:56

Does any one know how to perform a SOAP call from Clojure Script?


If I were running CLJS on a Node server, I’d probably use an npm package ( That would mean learning how to integrate npm and CLJS, though, and I’ve managed to avoid that so far.


@manutter51 :npm-deps should give you that, even if it's still in "testing" phase. In my case for instance I am using pg, node Postgres bindings from Cljs


I'm trying to use add-watch in an async test. it doesn't seem to be running correctly


(t/deftest test-with-watch
  (t/async done
    (let [state-atom (thing-that-returns-atom-and-eventually-changes)]
      (add-watch state-atom
                          (fn [_key _atom old-state new-state]
                             (println old-state)
                             (println new-state)
                             (remove-watch state-atom :query)
                             (t/is false)
                             (done) )))))


nothing prints and the (t/is false) doesn't cause it to fail


ah, I figured it out. the thing-that-returns-atom-and-eventually-changes isn't returning the atom correctly. PEBKAC


second question: is there an easy/simple/tested pattern for creating cursors out of atoms?


e.g. I have (atom {:foo "bar"}) and I want to get an atom that will only watch the value of :foo for changes


I'm about to start making my own out of add-watch but I'm afraid of messing up cleanup of the watches


ok, went ahead and implemented a simple cursor. now I have a 3rd question! 😄


is there a way to set a timeout for an async test in cljs?


Is there anything like this for reagent ?


@dnolen ah, so the answer to “missing filename” is simply that it isn’t implemented yet? I’ll have a look and see if I understand what’s going on 🙂


@christian767 rather our reporting probably needs to be made more robust, not simply filename


I am trying to consume the @google/maps ( NPM module from cljs, but compilation is failing with Error: Can't resolve 'util' in 'node_modules/@google/maps/lib'. I have tried both cljs 1.10.238 as well as cljs built from master. Has anyone been able to consume the @google/maps module from cljs or have any pointers?


If possible, could you write a JIRA for this? See