fix integration test

This commit is contained in:
crapStone 2023-11-19 22:54:42 +01:00
parent f79d7501a4
commit 2238a57801
No known key found for this signature in database
GPG key ID: D74B82E7CDD863FE
4 changed files with 18 additions and 6 deletions

View file

@ -1,6 +1,7 @@
package config
import (
"context"
"os"
"testing"
@ -15,10 +16,13 @@ func runApp(t *testing.T, fn func(*cli.Context) error, args []string) {
app := cmd.CreatePagesApp()
app.Action = fn
appCtx, appCancel := context.WithCancel(context.Background())
defer appCancel()
// os.Args always contains the binary name
args = append([]string{"testing"}, args...)
err := app.Run(args)
err := app.RunContext(appCtx, args)
assert.NoError(t, err)
}