Closed rkmax closed 4 years ago
@rkmax thx for the issue and the PR. It's something that we definitely need to fix.
Regarding suggestions I've just tried both scenarios in mocha (were we inspired to create goblin) and none of them produce a process.exit
output.
Describe
block an empty container. It doesn't print anything to the test output at allI believe this behavior might be desirable over panicking the test run.
it
blocks without any parent describe structures. I'll run the test normally without any context. This one is a bit trickier as we haven't taken this into account when creating goblin. How about if we just print a warning message instead of making the test suite to panic?.
Oh, that for sure is more desirable behavior. I'll try to replicate it with my current limited experience with golang and goblin source code
Today I shame myself by not writing properly testing. when the test succeeds everything is good, but when fails a nasty
SIGSEGV: segmentation violation
appear and there's no clue why this is happeningThese are the two examples I just did the first one, later just checking if happen also with the second
Describe without It
the panic raises when goblin.go#L344 is executed, currentIt is nil
It without Describe
the panic raises when goblin.go#L279 is execute, parent is nil
I think would be very nice include some internal error handling when either currentIt or parent is nil