Add web push tests
This commit is contained in:
parent
ff5c854192
commit
a9fef387fa
20 changed files with 372 additions and 41 deletions
24
cmd/web_push_test.go
Normal file
24
cmd/web_push_test.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
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...))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue