sci

Macroz 2023-05-26T08:19:35.186809Z

Hey, what's a good way to expose clojure.test to SCI so that I can have some code that tests itself too?

borkdude 2023-05-26T08:28:11.602389Z

Is this JVM or JS?

Macroz 2023-05-26T08:37:32.408429Z

JVM

borkdude 2023-05-26T09:04:57.247569Z

Are you producing a binary with SCI?

Macroz 2023-05-26T09:12:36.848479Z

Yeah, uberjar with SCI that enables someone to write plugins, and hopefully test them also.

Macroz 2023-05-26T09:13:24.867089Z

Not a binary as in CLI or native program.

borkdude 2023-05-26T09:37:22.086749Z

You can look at babashka.impl.clojure.test and babashka.impl.test how it's integrated in babashka itself. All the calls to babashka.impl.common/ctx you can replace with sci.ctx-store/get-context Make sure you register your context with sci.ctx-store/reset-context!

borkdude 2023-05-26T09:37:55.972749Z

I'd be good to have this in sci.configs: https://github.com/babashka/sci.configs There is a configuration available for cljs.test but not for JVM, but this could be factored out of babashka

Macroz 2023-05-26T09:38:36.524769Z

Nice, I wasn't aware of such a page :)

Macroz 2023-05-26T09:39:45.058509Z

Another "library" I had some hair-pulling moments with is clojure.tools.logging

borkdude 2023-05-26T09:41:13.441539Z

this is also in babashka. so you can have a look at how it's done there too

borkdude 2023-05-26T09:41:38.705269Z

feature-logging/babashka/impl/logging.clj

borkdude 2023-05-26T09:42:08.686519Z

also welcome to extract into sci.configs

borkdude 2023-05-26T09:42:29.486209Z

it's "complected" with the taoensso.timbre config there right now

Macroz 2023-05-26T09:45:03.373689Z

Thanks, I'll have a look,

Macroz 2023-05-26T10:04:25.160299Z

Hmm, so how are the macros from babashka.impl.clojure.test exposed to SCI? That's something I missed. The context is defined in there but not everything is added?

borkdude 2023-05-26T10:05:26.204749Z

> You can look at babashka.impl.clojure.test and babashka.impl.test So those two namespaces together

👍 1