Fork me on GitHub
#cursive
<
2016-09-28
>
Pablo Fernandez16:09:17

Is there a way to get test errors in the repl, not just the report at the end?

darwin16:09:07

@pupeno you mean compiler errors? or something your own code prints?

darwin16:09:55

ah, ok, I understand, test errors printed by cljs.test macros, right?

Pablo Fernandez16:09:01

I mean the error generated by the is function.

darwin16:09:35

hm, it is using normal println by default, so it should work, and you don’t see them at all or they all get printed at once at the end with report summary?

darwin16:09:42

how are you connected to REPL? using a script or via nREPL

darwin16:09:44

I’m just playing with some nREPL stuff for Dirac, so I thought I could give at least some help in case of nREPL

Pablo Fernandez16:09:13

I have it configured as run nrepl with leiningen

Pablo Fernandez16:09:33

I see the end report summary of how many errors and failures there were

Pablo Fernandez16:09:41

And I can also see things I print.

Pablo Fernandez16:09:56

But not the error reports from the test macros.

Pablo Fernandez16:09:30

The test functions do get marked as failed and the failed badge has that output, but a 50 line tool tip is hard to read.

Pablo Fernandez16:09:08

BTW, I just con be two devs to Cursive at work (Credit Suisse) and we are thinking of standardizing in Cursive for pair programming.

darwin16:09:55

can you run lein repl from command-line and run your tests there?

Pablo Fernandez16:09:21

Does run test in the repl still work?

darwin16:09:39

well, how cursive does it?

darwin16:09:05

I assumed it runs that lein command, connects to nrepl and then runs all tests using cljs.test

Pablo Fernandez16:09:11

I thought it was nrepl magic.

darwin16:09:42

if it does its own magic there, then I can understand that something might not work 🙂

Pablo Fernandez16:09:15

I think it's not a bug, it's a feature.

darwin16:09:19

anyways, if your own println works, you can define your own cljs.test :reporter and implement your own printing to work around this issue I guess

Pablo Fernandez16:09:32

I think that output is hidden on purpose.

darwin16:09:52

I assume cursive defined its own reporting functions and intercepting them

Pablo Fernandez16:09:05

And having badges next to each assertion telling you which one passed and which one failed is great.

darwin16:09:11

yeah, now I looked at cursive docs, the test support looks good 🙂

Pablo Fernandez16:09:31

Yeah... In those screenshot you can see the lack of error output.

darwin16:09:40

and it is for clojure only I assume, I was automatically thinking about cljs, so forget what I wrote 😉

cfleming16:09:43

@pupeno There isn’t right now, no, although a couple of people have asked for it.

cfleming16:09:22

Most people don’t want it cluttering up their REPL if they’re using the GUI functionality

cfleming16:09:53

BTW instead of using the tooltip, you can click on the error icon and get a visual diff.

cfleming16:09:39

Cursive basically uses clojure.test functionality, but it hooks the test reporting to get the information it needs for the icons etc.

Pablo Fernandez16:09:37

In my team some people would like to get the output anyway

Pablo Fernandez16:09:18

Something that I think can help a lot would be for the window with the diff, which I think is great, to be a proper top level window.

Pablo Fernandez16:09:39

In Windows it cannot be maximized

darwin16:09:15

@pupeno I think you can always re-hook the test reporting and do whatever you want there, e.g call cursive and then print your own thing

bfabry18:09:30

@pupeno I'm sure you know this, but if you want to just run the test in the repl and get the output sans cursive you can do (clojure.test/run-tests your-test-ns.t-test)

Pablo Fernandez18:09:03

bfabry not using the keymap is too high of a price to pay though.

bfabry18:09:41

fair enough