1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2024-11-09 05:14:15 +01:00
ntfy/cmd/web_push_test.go

25 lines
557 B
Go
Raw Normal View History

2023-05-29 17:57:21 +02:00
package cmd
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/urfave/cli/v2"
"heckel.io/ntfy/server"
)
func TestCLI_WebPush_GenerateKeys(t *testing.T) {
app, _, _, stderr := newTestApp()
require.Nil(t, runWebPushCommand(app, server.NewConfig(), "generate-keys"))
require.Contains(t, stderr.String(), "Keys generated.")
}
func runWebPushCommand(app *cli.App, conf *server.Config, args ...string) error {
webPushArgs := []string{
"ntfy",
"--log-level=ERROR",
"web-push",
}
return app.Run(append(webPushArgs, args...))
}