Removing specific tests in Clojure REPL

In Clojure, I decided to move from record metadata elements :test for use deftest . To make sure that I wrote deftest , I will try to restart and run the tests with a reboot in the REPL.

While I do not care about repeating tests as such, when I delete a test from the source, I would like to delete it when the source is reloaded. Clearing REPL does not remove tests.

So how much do I remove tests defined through deftest from Clojure REPL

+6
source share
2 answers

clojure.test finds test vars, reflecting on namespaces, so you can use ns-unmap. See my previous answer to a similar question for full details.

+6
source

I don't think you can remove vars one by one in clojure (maybe I'm wrong, this seems like a weird oversight, if true). The easiest way to get rid of old definitions is to probably use remove-ns to get rid of the namespace and then reevaluate the file name / namespace / definition.

0
source

Source: https://habr.com/ru/post/886073/


All Articles