bhauman / devcards

Devcards aims to provide a visual REPL experience for ClojureScript
1.53k stars 113 forks source link

Test cards only run the last test if the whole card is defined as a "let" #22

Closed emanchado closed 9 years ago

emanchado commented 9 years ago

It seems that defining a test card as a let block makes the card only execute the last test. At first I didn't realise that each test should have a row with results (I'm just getting started with devcards), so I didn't even realise that my tests were failing! For someone more familiar with devcards is less of a problem, but still...

Example code:

(defcard bug-testcase
  (dc/test-card
   "Test case for let bug in devcard's test card"
   (let [expected 1]
     (dc/are= expected 0)
     (dc/are= expected 1))))

I imagine this is a bug and not expected behaviour, and I hope it's possible to fix :-)

bhauman commented 9 years ago

If you return a list of tests this will work correctly.

I'm probably going to be redoing most of this over the next month. And try to use cljs.test for testing. Devcards is going to undergo a big make over hopefully :)

bhauman commented 9 years ago

And a simplification as well.

bhauman commented 9 years ago

This has been addressed with the latest release of devcards which now uses cljs.test!