midje

lassemaatta 2025-08-22T05:25:06.948679Z

lein-midje + midje seems to support also running plain clojure.test tests. However, it looks like it only scans .clj files for namespaces containing tests. Are .cljc files intentionally skipped?

Phillip Mates 2025-08-22T08:02:14.466119Z

there is https://github.com/marick/Midje/issues/339 and https://github.com/marick/Midje/issues/442 that talk about it a bit. Pretty unlikely I'll dive into it though. Happy to review and do a release for a patch that fixes it 🙂

lassemaatta 2025-08-22T08:23:48.214479Z

yeah, I found those two. I tried browsing through the midje code base but couldn't really find where the clojure.test tests are handled, just in case there's an easy fix to be found.

Phillip Mates 2025-08-22T13:39:50.252809Z

maybe midje.data.project-state/namespaces is what finds all the files to process

Phillip Mates 2025-08-22T13:40:40.146229Z

midje.emission.clojure-test-facade handles the clojure.test stuff, but that doesn't matter here because it is more about what files are chosen to be processed

Phillip Mates 2025-08-22T13:40:58.113319Z

(haven't looked at the code in years, so just quick guesses after some grepping)

Phillip Mates 2025-08-22T13:49:18.583969Z

as one of the issues mentions, it might be tricky to handle the clj/cljs reader macro things. Midje has many layers of macros for processing stuff and so if it doesn't just work to feed it cljc files you may find yourself lost in a deep forest of macros 🙂

lassemaatta 2025-08-22T13:50:26.395459Z

macros, macros everywhere 🧑‍🚀

lassemaatta 2025-08-22T13:54:23.613449Z

on the other hand, I'm not really trying to teach midje to fully support .cljc. The story here is that we have several hundreds of test namespaces; a mix of maybe 75% midje and the rest are plain clojure.test. Within the clojure.test tests there are a bunch of .cljc tests. I had assumed that lein-midje would also run the .cljc clojure.test tests, but was surprised to find out our unit tests were ignoring them.

lassemaatta 2025-08-22T05:31:37.472859Z

I understand that midje itself doesn't explicitly support .cljc and I wouldn't expect that (fact ... -stuff would work in e.g. cljs, but I would still assume that clojure.test tests in .cljc would be executed just fine.