File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import (
12
12
"math"
13
13
"sort"
14
14
"strings"
15
- "testing"
16
15
)
17
16
18
17
// MockGlobalClient replaces the global telemetry client with a custom
@@ -30,8 +29,16 @@ func MockGlobalClient(client Client) func() {
30
29
}
31
30
}
32
31
32
+ // Errorfer is an interface that allows to call the `Errorf` method.
33
+ // This is the same interface as `testing.T` because the goal of this
34
+ // interface is to remove the need to import `testing` in this package
35
+ // that is actually imported by users.
36
+ type Errorfer interface {
37
+ Errorf (format string , args ... any )
38
+ }
39
+
33
40
// Check is a testing utility to assert that a target key in config contains the expected value
34
- func Check (t * testing. T , configuration []Configuration , key string , expected interface {}) {
41
+ func Check (t Errorfer , configuration []Configuration , key string , expected interface {}) {
35
42
for _ , kv := range configuration {
36
43
if kv .Name == key {
37
44
if kv .Value != expected {
You can’t perform that action at this time.
0 commit comments