1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2024-12-14 11:47:33 +00:00
binwiederhier-ntfy/cmd/webpush_test.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
559 B
Go
Raw Permalink Normal View History

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