Skip to content

Commit 788cc18

Browse files
committed
feat(cli): add test for delete command
This adds a test for the `delete` command when it's called without any arguments to ensure is returns the custom error message.
1 parent de2f33c commit 788cc18

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

cli/delete_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package cli_test
2+
3+
import (
4+
"testing"
5+
6+
"github.com/stretchr/testify/require"
7+
8+
"github.com/coder/coder/cli"
9+
"github.com/coder/coder/cli/clitest"
10+
)
11+
12+
func TestDelete(t *testing.T) {
13+
t.Run("WithoutParameters", func(t *testing.T) {
14+
t.Parallel()
15+
16+
cmd, _ := clitest.New(t, "delete")
17+
18+
err := cmd.Execute()
19+
require.ErrorContains(t, err, cli.DeleteError)
20+
})
21+
}

0 commit comments

Comments
 (0)