Fork me on GitHub

I’m trying to run a test in clojurescript, but the test isn’t running. I’ve this in the file:


(ns humboi.core
(:require [humboi.core :as sut]
            ["@testing-library/react-native" :refer [render fireEvent]]
            [humboi.auth.core :refer [google-sign-in-comp]]
            [cljs.test :as t :include-macros true]))

(defn mount! [component]
  (render (r/as-element component)
          #js {:container (testing-container)}))

(deftest google-login-test
  (is (mount! [google-sign-in-comp])))

After which I’m loading the cider buffer. But the test isn’t running. How to fix this?


Are protocols only implemented at the js prototype level or is there something else going on? Just trying to better understand the performance of a protocol function call vs a "regular" function call


it might be helpful to explore it in


it looks like (and this also matches my memory) calling a protocol method foo does the following: • looks up the method on the prototype and if found, executes that • checks a global registry and if an implementation is found, executes that (this is useful for things like object and nil) there's a third thing that it might do if you allow your protocol to be extended via metadata, which is look it up on the object's metadata and if found, executes the function found there

👍 3

Having a little trouble getting adjusted to the clojurescript tooling.


I created a new re-frame project use lein new re-frame my-app-name. I'm using emacs so I'm able to start a shadow repl using :cider-jack-in-cljs. However it blows up after I provider the app name to build.


I figured it would just be my-app-name


Error: Execution error (ExceptionInfo) at shadow.cljs.devtools.server.runtime/get-instance! (runtime.clj:11) . missing instance


Am I looking more for "watch", "dev", etc as defined in project.clj?


Maybe I need to lein watch first and then jack in via emacs?


oh that template uses the awkward lein-shadow plugin. if you run lein shadow compile it will output the correct shadow-cljs.edn file and run npm install and such. After that, you can delete all the lein-shadow stuff and the nested shadow-cljs.edn inside of the project.clj and it will be a normal shadow project


that plugin is an attempt to keep everything inside of the project.clj file. the result is all your dependencies in one file and tooling and documentation no longer match up with the setup so to me its a poor tradeoff


Ah okay! I will go down that route. I appreciate it, I was very confused.


Once I've done that the :cider-jack-in-cljs should be enough to start the project?


Hey, look at me! I have a running re-frame app!

Daniel Tobias19:01:27

I am using figwheel-main reagent template and having a lot of issues with my django backend. In my figwheel-main.edn i am specifying a target-dir which a relative path to the static folder of my django project. This creates the dev-main.js in the correct spot however the issue is dev-main.js is trying to load dependencies using the same target-dir + some stuff which simply will not do. Is there any way to change this?

AJ Jaro20:01:32

I don’t use django, but use relative paths as well and am not experiencing this. I wonder if there’s some other piece to configure here to make sure those dependencies within your compiled script are resolved differently

Daniel Tobias20:01:10

@UGMAVSMUM if i look at my dev-mains.js its this:

window.CLOSURE_UNCOMPILED_DEFINES = {"figwheel.repl.connect_url":"ws:\/\/localhost:9500\/figwheel-connect?fwprocess=146268&fwbuild=dev"};
window.CLOSURE_NO_DEPS = true;
if(typeof goog == "undefined") document.write('<script src="/cljs-out/dev/goog/base.js"></script>');
document.write('<script src="/cljs-out/dev/goog/deps.js"></script>');
document.write('<script src="/cljs-out/dev/cljs_deps.js"></script>');
document.write('<script>if (typeof goog == "undefined") console.warn("ClojureScript could not load :main, did you forget to specify :asset-path?");</script>');
the script src here is literally just target-dir appended with some stuff. At this point i dont even care if i can get relative paths working i just want to be able to have this generate correct/different paths. I am using the default project produced by lein new figwheel-main app -- --reagent btw

Daniel Tobias20:01:20

hang on i will try with the +npm-bundle option

Daniel Tobias20:01:17

meh, idk what to do

Daniel Tobias20:01:21

how do i just compose like a single js file i can throw into my static files

Daniel Tobias20:01:56

how are you using relative paths btw?


FWIW there's also #figwheel-main where you might get better traction.

Daniel Tobias20:01:29

sure, but looks dead

☝️ 3

Looks can be deceiving. :) Library and tool authors and maintainers often pay much closer attention to their own channels than to this general one.

Daniel Tobias20:01:09

i dont even care about figwheel since i would be fine just producing a single js file for use

Daniel Tobias20:01:17

i dont understand why this has to be such a horrible confusing process

Daniel Tobias22:01:22

i think i fixed it for now

👍 3