Now every It that receives a done Done parameter is expected to be async, which means that you either finish the test by calling done() or g.Fail()
To do this, panic is not supported anymore, as go doesn't allow to recover panics from goroutines, being outside of a goroutine, which sucks.
So now everything relies on Fail function to mark if a test passed or failed.
All assertion libraries are expected to call Fail method.
An async test looks like this:
g.It("Does something async", func(done Done) {
go func() {
time.Sleep(100 * time.Millisecond)
g.Fail("foo is not bar")
}()
})
Now every
It
that receives adone Done
parameter is expected to be async, which means that you either finish the test by callingdone()
org.Fail()
To do this,panic
is not supported anymore, as go doesn't allow to recover panics from goroutines, being outside of a goroutine, which sucks. So now everything relies onFail
function to mark if a test passed or failed. All assertion libraries are expected to callFail
method.An async test looks like this: