testing

Testing tools, testing philosophy & methodology...
2016-02-15T19:55:29.000003Z

(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?

2016-02-15T21:27:43.000004Z

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

2016-02-15T21:39:02.000005Z

@jaredly: I use (comment ...)

2016-02-15T21:40:01.000006Z

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

2016-02-15T21:40:33.000007Z

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

nberger 2016-02-15T21:57:32.000008Z

@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.

2016-02-15T22:00:58.000009Z

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

nberger 2016-02-15T22:02:56.000010Z

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

2016-02-15T22:06:42.000011Z

good to know