samedi 20 août 2016

How can I get exceptions from a Ring server passed to my Cider test runner?

I run integration tests in Emacs using Cider's test runner, against a Jetty/Ring server that is started on port 3001 by a test fixture. I use clj-http to make requests to this server.

When an exception occurs in the server, the exception is logged to the *nrepl-server* buffer. This works OK, but it means I don't get the nice exception handling that Cider provides, with the ability to jump to the matching code from the backtrace.

Is there any existing way to funnel the exception from the server into the live Cider instance? Is this sane or even possible?

(I'm aware this might be a "code smell", because I should be able to reproduce many of these issues with unit tests that do not touch a server. However I have many issues that reproduce only in the server environment, and I'm quite happy with the current approach.)

Aucun commentaire:

Enregistrer un commentaire