-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_test.go
More file actions
36 lines (30 loc) · 889 Bytes
/
example_test.go
File metadata and controls
36 lines (30 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package testrig_test
import (
"context"
"fmt"
"github.com/smartcontractkit/testrig"
)
func ExampleRun() {
testrig.Run(
// GlobalSetup runs once before any tests start.
testrig.GlobalSetup(func(_ context.Context) error {
fmt.Println("Starting mock background service...")
return nil
}),
// IterationSetup runs before each diagnose iteration.
testrig.IterationSetup(func(_ context.Context) error {
fmt.Println("Resetting database state for next iteration...")
return nil
}),
// IterationTeardown runs after each diagnose iteration.
testrig.IterationTeardown(func(_ context.Context) error {
fmt.Println("Cleaning up iteration artifacts...")
return nil
}),
// GlobalTeardown runs once after all tests finish.
testrig.GlobalTeardown(func(_ context.Context) error {
fmt.Println("Stopping mock background service...")
return nil
}),
)
}