This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-20
Channels
- # announcements (26)
- # babashka (25)
- # beginners (16)
- # biff (12)
- # calva (36)
- # clj-commons (4)
- # clj-kondo (3)
- # clojars (1)
- # clojure-art (1)
- # clojure-dev (1)
- # clojure-europe (10)
- # clojure-gamedev (1)
- # clojurescript (7)
- # clr (10)
- # fulcro (10)
- # helix (6)
- # introduce-yourself (2)
- # malli (7)
- # matrix (203)
- # off-topic (12)
- # pedestal (4)
- # practicalli (2)
- # reagent (5)
- # specter (1)
- # sql (8)
- # vim (1)
- # xtdb (5)
How do I run all tests from the command line, with a non-zero exit code if something fails?
I added (run-all-tests)
to the end of my test file and I can run all of them with clj test_file.clj
, but it exits with 0 instead of 1.
This is with deps.edn and tools.build, is there a function you can add to builds.clj that will solve it all?
I’m still not at home with clj. I’ve run it in a project dir with a src
and then I (ns my.namespace)
and find that nothing is in scope.
Lots of people here happy to help, but will need some more info than that. "nothing" == ?? what exactly do you see?
> clj
user=> (require '[my.namespace :as my])
nil
user=> (my/func 1 2 3)
☝️:skin-tone-2: That would be a reasonable way to work, with a short alias to your namespace. Or perhaps this approach:
> clj
user=> (require 'my.namespace)
nil
user=> (in-ns 'my.namespace)
...
my.namespace=> (func 1 2 3)
It's important to require
the namespace first -- to load it from disk into the REPL -- and then to switch the REPL into it (with in-ns
).
If you call in-ns
without loading your code, it will be an empty namespace.Is there a blessed path that goes zero through basic development setup through to baby’s first deployment?
Depending on where you are on your Clojure journey (and assuming you're asking about Clojure rather than ClojureScript), perhaps this will help? https://clojure-doc.org/articles/ecosystem/libraries_authoring/
Are you working with Leiningen or with the Clojure CLI @U0KLE4WHZ?
I suppose that’d be part of the question @U04V70XH6, the one that were the more straightforward of the two to get started with that path
Well, Clojure CLI is the official, supported tooling from the core team and is rising in popularity. You'll find docs for that on http://clojure.org (you will not find Leiningen documented on the official site but it appears in a lot of books and tutorials, since it's been around much longer). https://clojure-doc.org/articles/tutorials/getting_started/ talks about why both exist and how they differ.
At work, we started with Clojure back in 2010/2011 and Leiningen was the only option. We switched from that to Boot in 2015, and from Boot to the Clojure CLI in 2018.
I recommend beginners learn about the Clojure CLI these days because it's what most current work is targeting for Clojure (JVM), ClojureScript, and now for ClojureCLR.
