From cf6496bb8f78cf8b23d53ab0d8a24832971ef265 Mon Sep 17 00:00:00 2001 From: chahat arora <42025842+chahat-arora@users.noreply.github.com> Date: Sun, 27 Oct 2019 16:12:21 +0530 Subject: [PATCH] Migrate tests from app/command_test.go to use testify (#12659) * Migrate tests from app/command_test.go to use testify * minor fix * minor fix * minor fix --- cmd/mattermost/commands/command_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/mattermost/commands/command_test.go b/cmd/mattermost/commands/command_test.go index b3e304c4da..63227457f6 100644 --- a/cmd/mattermost/commands/command_test.go +++ b/cmd/mattermost/commands/command_test.go @@ -119,13 +119,11 @@ func TestCreateCommand(t *testing.T) { require.Nil(t, response.Error, "Failed to list commands") if testCase.ExpectedErr == "" { - require.NotEmpty(t, cmds, "Failed to create command") - require.Equal(t, "testcmd", cmds[0].Trigger) + assert.NotZero(t, len(cmds), "Failed to create command") + assert.Equal(t, cmds[0].Trigger, "testcmd", "Failed to create command") assert.Contains(t, string(actual), "PASS") } else { - if len(cmds) > 1 { - require.Fail(t, "Created command that shouldn't have been created") - } + assert.LessOrEqual(t, len(cmds), 1, "Created command that shouldn't have been created") assert.Contains(t, string(actual), testCase.ExpectedErr) } })