File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 2
2
Package assert includes runtime assertion helpers both for normal execution as
3
3
well as a assertion package for Go's testing. What makes solution unique is its
4
4
capable to support both modes with the same API. Only thing you need to do is to
5
- add a [PushTester] line at the beginning of your unit tests:
5
+ add a [PushTester] line at the beginning of your unit tests and its
6
+ sub-gouroutines:
6
7
7
8
func TestInvite(t *testing.T) {
8
9
defer assert.PushTester(t)() // push testing variable t beginning of any test
@@ -12,7 +13,7 @@ add a [PushTester] line at the beginning of your unit tests:
12
13
assert.Equal(alice.Len(), 1) // assert anything normally
13
14
...
14
15
go func() {
15
- defer assert.PushTester(t)() // <-- Needs to do again for new goroutine
16
+ assert.PushTester(t) // <-- Needs to do again for a new goroutine
16
17
17
18
# Merge Runtime And Unit Test Assertions
18
19
You can’t perform that action at this time.
0 commit comments