-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Running tests in figwheel's CLJS repl #1268
Comments
I have a clojurescript / clojurec project that uses cljs.test too, but it works for me. I set up my tests with reader conditionals to make them portable both to clojure and clojurescript. Perhaps you could work around the issue that way, if your tests are portable. |
What does your project.clj look like? It's possible it cannot find the tests due to misconfiguration. |
Unfortunately, my tests are not meaningfully portable. They rely heavy on the DOM. The code I'm writing is a GreaseMonkey userscript, so differences between implementations (different browsers or maybe a JVM implementation somewhere) are important. Here's my (defproject crunch "0.1.0-SNAPSHOT"
:description "A workout for your CORE"
:url "https://github.com/lvh/crunch"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.107" :scope "provided"]
;; Fancy pattern matching & logic programming
[org.clojure/core.match "0.3.0-alpha4"]
[org.clojure/core.logic "0.8.10"]
;; React
[cljsjs/react "0.13.3-1"]
[reagent "0.5.0"]
[reagent-forms "0.5.6"]
[reagent-utils "0.1.5"]
;; Bootstrap tricks
[wilson "0.9.0"]
;; DOM tricks
[prismatic/dommy "1.1.0"]
[hickory "0.5.4"]
;; Time
[com.andrewmcveigh/cljs-time "0.3.11"]
;; Debugging and logging
[com.taoensso/timbre "4.1.1"]]
:source-paths ["test" "src"]
:target-path "target/%s"
:clean-targets ^{:protect false} [:target-path "out" "resources/public/cljs"]
:cljsbuild {:builds {:app {:source-paths ["src" "test"]
:figwheel true
:compiler
{:main "crunch.core"
:asset-path "cljs/out"
:output-to "resources/public/cljs/main.js"
:output-dir "resources/public/cljs/out"}}
:test {:source-paths ["src" "test"]
:main "crunch.runner"
:compiler {:output-to "target/test.js"
:optimizations :whitespace
:pretty-print true}}}}
:profiles
{:dev-common
;; (use 'figwheel-sidecar.repl-api) (figwheel-sidecar.repl-api/cljs-repl)
{:dependencies [;; Client side building
[figwheel "0.3.7"]
[cljsbuild "1.1.0"]
[org.clojure/tools.nrepl "0.2.10"]
;; Client side testing
[doo "0.1.4"]
[org.clojure/core.async "0.1.346.0-17112a-alpha"]]
:plugins [[lein-figwheel "0.3.7"]
[lein-cljsbuild "1.1.0"]
[lein-doo "0.1.4"]
[lein-cljfmt "0.2.1"]]
:figwheel {:css-dirs ["resources/public/css"]
:nrepl-port 7002}
:env {:dev true}}
:dev-overrides {};; Set this in profiles.clj
:dev [:dev-common :dev-overrides]}) |
From what you've described of the problem, it sounds like the content of the tests is probably irrelevant. |
Sorry; I somehow missed that you gave a suggestion of finding the issue:
The namespaces are appropriate for that sturcture, e.g. @sp3ctum Are you using figwheel's REPL? I think this might have something to do with it... |
Yeah, I'm using figwheel's repl. I think with that structure your tests
should work if they're in namespaces such as shrieker.foo.
|
Closing this as it doesn't seem like there's anything for the CIDER team to do here. Feel free to re-open if that isn't the case. |
How could I make this actionable? Would a public repo and reproduction steps (that show the problem for me) help? |
@lvh yes, that would be great |
OK, steps that reproduce for me:
Given your earlier comments I'm guessing you can reproduce everything, except that |
@lvh I was going by @sp3ctum's comments. I got the impression it was working fine for him and that this was about the structure of the project. |
@sp3ctum: Could you check if the above repro works for you? |
Hi guys, I just tried with @lvh 's repro instructions, and could reproduce everything just like he said.
On Windows 7, did not use rlwrap :) |
Actually I can reproduce this in another project as well. I never used the feature with cljs so I must have missed the fact it did not work. |
running tests in clojurescript is currently not working according to the docu and the source I've read |
Is problem still available ? |
Yes, this problem is still unresolved. I can reproduce it in my project here https://github.com/sp3ctum/squanmate like this:
When doing this, I get this output: Using
|
I am on it, but I am so newbie. @sp3ctum, Thanks for the reply! |
Having the same issue...
|
In my case, I was able to work around the issue by using doo which was a really easy way to setup a continuous test runner (watcher) that compiles cljs->js and then runs unit tests. If you're struggling with running your tests, maybe that can help right now. |
I agree, that's for running all tests... |
Yeah you're definitely right. Doo only runs all tests at the same time, and
it can get confusing when you have a lot of failures, since the errors pile
up and become unreadable.
…On Jan 26, 2018 10:49, "kurtosys" ***@***.***> wrote:
I agree, that's for running all tests...
But it doesn't solve the problem to run tests with cider-nrepl. It's
pretty nice to just run a test (and show the result inline) with a shortkey
from you editor while programming. I'd love to have that functionality in
cljs. Not sure how to do that with doo.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1268 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AASW9_h6RI3V8LgTWDbWAoVJaO3KXle-ks5tOZGQgaJpZM4FupKx>
.
|
Yeah, it's not only about having a lot of failures, it's also about: if I need only 1 or 2 tests to run, I don't want to compile and run everything over and over again. It'd be about checking my cljs code (not about a full compiled version of my app). Anyway... I'd just love to see running tests working, so I can integrate it in my workflow similar to what I do in clojure. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding! |
The test runner functionality is Clojure-only at the moment. Changing this is on the roadmap, but given our limited resources I doubt we'll tackle it soon. |
I have some
cljs.test
tests. I'm connected to the REPL ran by figwheel, and have run(use 'figwheel-sidecar.repl-api) (figwheel-sidecar.repl-api/cljs-repl)
to get a cljs repl. Compiling and evaling CLJS works fine, but CIDER's test functionality appears to be confused.cider-test-run-tests
(C-c ,
) claims it can't find the relevant namespace:... when run from either
crunch.ctk
orcrunch.ctk-test
, even though I can run/eval stuff in there just fine.The text was updated successfully, but these errors were encountered: