Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: prepare release #724

Merged
merged 5 commits into from
Feb 24, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: add coverage for is reviewpad command run
  • Loading branch information
zolamk committed Feb 24, 2023
commit 6ba7d7f894defc1955608aaf2e482d2c2ea07c55
26 changes: 26 additions & 0 deletions utils/pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,29 @@ func TestIsReviewPadCommand(t *testing.T) {
})
}
}

func TestIsReviewpadCommandRun(t *testing.T) {
tests := map[string]struct {
command string
wantVal bool
}{
"when command is empty": {
wantVal: false,
},
"when command is not /reviewpad run": {
command: "/reviewpad assign-reviewers",
wantVal: false,
},
"when command is /reviewpad run": {
command: "/reviewpad run",
wantVal: true,
},
}

for name, test := range tests {
t.Run(name, func(t *testing.T) {
val := utils.IsReviewpadCommandRun(test.command)
assert.Equal(t, test.wantVal, val)
})
}
}