spek
spek copied to clipboard
Skip API feels clunky
I do find the skipping/ignoring API to be a bit clunky. No matter which way I use it:
it("should do something", skip = Skip.Yes("Some reason"))
it("should do something", Skip.Yes("Some reason"))
Given that we have describe and it that make naming things much easier, would not it make sense to also incorporate the skipping part semantically into the structure?
Here's some example of what I mean, although I'm not super happy with it either.
it("should do something", skipping = because("Some reason"))
Maybe someone else has better ideas?
You could always use x variants of describe, context and it.
xit("should do something", reason = "some reason") {
...
}
I could yeah but why not improve the API so that everyone can benefit from it?
@vanniktech wdyt about skip = because("Some reason")? I don't think it's a good idea to rename the existing parameter skip to skipping. Just a side note, one caveat with this approach of skipping vs using x prefixed synonyms is that the IDE won't know that the scope is supposed to be skipped.
I like it!