2021-09-29 15:38:50 +00:00
|
|
|
package build_test
|
|
|
|
|
2023-01-29 10:54:56 +00:00
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"testing"
|
2021-09-29 15:38:50 +00:00
|
|
|
|
2023-01-29 10:54:56 +00:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
"go.uber.org/goleak"
|
|
|
|
"go.uber.org/zap"
|
|
|
|
|
2023-02-23 17:49:45 +00:00
|
|
|
"gh.tarampamp.am/error-pages/internal/cli/build"
|
2023-01-29 10:54:56 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestNewCommand(t *testing.T) {
|
|
|
|
defer goleak.VerifyNone(t)
|
|
|
|
|
|
|
|
cmd := build.NewCommand(zap.NewNop())
|
|
|
|
|
|
|
|
assert.NotEmpty(t, cmd.Flags)
|
|
|
|
|
|
|
|
assert.Error(t, cmd.Run(
|
|
|
|
cli.NewContext(cli.NewApp(), &flag.FlagSet{}, nil),
|
|
|
|
"",
|
|
|
|
), "should fail because of missing external services")
|
2021-09-29 15:38:50 +00:00
|
|
|
}
|