Open alexey-komarov opened 3 years ago
I like this idea. Do we need a separate flag though? Why not just using the current run
flag and just change the current matchesRegex
line to use the GetFullName
function that you're proposing?
I don't think we're breaking backwards compatibility here, but just allowing to target Describe blocks as it's name
will be part of the regex target now.
@marcosnils Using one flag would be better for sure, but i always think about those who already using this feature in their pipelines, don't want to break anything :)
I don't think this is a very big deal since the run
flag is mostly used for development purposes and not generally CI pipelines. In any case, we can always release a new major.
Would you like to open a PR so we can get this merged?
One thing that I believe it's missing here is to keep recursing all the way up until parent == nil
. Since you can have multiple nested describe
blocks: i.e:
Describe("Some", func() {
Describe("Little", func() {
Describe("Rabbit", func() {
It("jumps", func(){})
})
})
})
So the ultimate run
regex should target "Some.Little.Rabbit.jumps" and if I read the code correctly it's only targetting "Rabbit.jumps" given the current patch.
Additionally, does it make sense to concatenate the blocks with .
? Why not :
or any other char? I don't have any specific preferences here, just wondering if it's the best we can do about it.
I'd like to see this but concatenated with spaces to match Mocha's fullTitle()
behavior
I'd like to run particular group of tests described via Describe(), just for developing purposes when I want to debug entire group, so i would really appreciate a separate flag, e.g -goblin.runFullName with the following behavior: