ring

Jérémie Salvucci 2022-08-17T14:00:37.110519Z

Hi, I'm using http-kit with ring and reitit to make an api and I'd like to test my main handler. I've seen that clojure.test + ring-mock was a thing to do unit testing. Is there anything else to perform this?

Ferdinand Beyer 2022-08-18T12:53:40.575549Z

Why are you looking for something else? It is hard to answer. There are alternatives to clojure.test such as midje, but it is not clear what exactly you want to know? In theory a ring handler is just an ordinary function, so you don’t need special tooling to test it. ring-mock definitely helps as it is a bit tedious to generate request maps your self.

Jérémie Salvucci 2022-08-19T09:56:58.618649Z

Oh, I just wanted to know if the following way of doing things was reasonable given the current state of the Clojure ecosystem (ring and http-kit related)

Jérémie Salvucci 2022-08-19T09:58:19.861049Z

Yes, generating requests is a bit tedious, so this ring-mock is useful, but maybe there is some other nice tools I'm not aware of related to handler testing, etc.