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

add test for getDiff function #1404

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions cmd/reviewdog/doghouse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,3 +549,16 @@ func absPath(t *testing.T, path string) string {
}
return p
}

func TestGetDiff(t *testing.T) {
cleanup := setupEnvs(map[string]string{
"GITHUB_ACTIONS": "",
"GITHUB_EVENT_PATH": "",
})
defer cleanup()
diff, err := getDiff(context.Background(), "haya14busa", "reviewdog", 14, "1414")
if err != nil {
t.Errorf("getDiff failed: %v", err)
}
want := `diff --git a/README.md b/README.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you don't check result of the getDiff call

}