Fork me on GitHub
#testing
<
2016-02-15
>
jaredly19:02:29

(cljs) is there a way to dynamically create tests without macros? e.g. I have a vector of test data, and I want to deftest for each so that they can fail independently. I looked into deftests source and it requires an interned var, which I can’t generate without macros afaik. Is there a better way to address this case?

jaredly21:02:43

looks like core.test doesn’t have a notion of a “skipped” test — do people just tend to comment things out?

bensu21:02:02

@jaredly: I use (comment ...)

bensu21:02:01

@jaredly: you want a different "The test failed" for each case in the test vector data?

bensu21:02:33

If it's only a matter of display, you could overwrite cljs.test/report to show the assertions differently.

nberger21:02:32

@jaredly another option is that you could wrap your assertions with cljs.test/testing for each element of the vector... You could even write your own test-ns-hook and run the the way you want... It would be great if you could explain what do you want differently in the output so we can help you better.

jaredly22:02:58

thanks, that’s helpful. I had thought that a failing iswould short-circuit and break out of the deftest… but that’s not the case

nberger22:02:56

If you want to have full control on how your tests run, test-ns-hookis the way to go

jaredly22:02:42

good to know