mirror of
https://github.com/spf13/cobra
synced 2025-05-05 12:57:22 +00:00
Fix tests
This commit is contained in:
parent
81f5a281aa
commit
ad45c7fb08
1 changed files with 2 additions and 0 deletions
|
@ -35,6 +35,7 @@ func Test_OnInitialize(t *testing.T) {
|
||||||
call = true
|
call = true
|
||||||
})
|
})
|
||||||
_, err := executeCommand(c)
|
_, err := executeCommand(c)
|
||||||
|
initializers = nil
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
@ -50,6 +51,7 @@ func Test_OnInitializeE(t *testing.T) {
|
||||||
return e
|
return e
|
||||||
})
|
})
|
||||||
_, err := executeCommand(c)
|
_, err := executeCommand(c)
|
||||||
|
initializersE = nil
|
||||||
if err != e {
|
if err != e {
|
||||||
t.Error("expected error: %w", e)
|
t.Error("expected error: %w", e)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue