mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 20:02:09 +00:00
Add testifylint to lint checks (#4535)
go-require lint is ignored for now Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4535 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: TheFox0x7 <thefox0x7@gmail.com> Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
This commit is contained in:
parent
94933470cd
commit
4de909747b
504 changed files with 5028 additions and 4680 deletions
|
@ -17,6 +17,7 @@ import (
|
|||
"code.gitea.io/gitea/services/pull"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestRenderConversation(t *testing.T) {
|
||||
|
@ -42,14 +43,12 @@ func TestRenderConversation(t *testing.T) {
|
|||
var preparedComment *issues_model.Comment
|
||||
run("prepare", func(t *testing.T, ctx *context.Context, resp *httptest.ResponseRecorder) {
|
||||
comment, err := pull.CreateCodeComment(ctx, pr.Issue.Poster, ctx.Repo.GitRepo, pr.Issue, 1, "content", "", false, 0, pr.HeadCommitID, nil)
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
}
|
||||
require.NoError(t, err)
|
||||
|
||||
comment.Invalidated = true
|
||||
err = issues_model.UpdateCommentInvalidate(ctx, comment)
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
}
|
||||
require.NoError(t, err)
|
||||
|
||||
preparedComment = comment
|
||||
})
|
||||
if !assert.NotNil(t, preparedComment) {
|
||||
|
@ -80,9 +79,9 @@ func TestRenderConversation(t *testing.T) {
|
|||
reviews, err := issues_model.FindReviews(db.DefaultContext, issues_model.FindReviewOptions{
|
||||
IssueID: 2,
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
for _, r := range reviews {
|
||||
assert.NoError(t, issues_model.DeleteReview(db.DefaultContext, r))
|
||||
require.NoError(t, issues_model.DeleteReview(db.DefaultContext, r))
|
||||
}
|
||||
ctx.Data["ShowOutdatedComments"] = true
|
||||
renderConversation(ctx, preparedComment, "diff")
|
||||
|
@ -93,9 +92,9 @@ func TestRenderConversation(t *testing.T) {
|
|||
reviews, err := issues_model.FindReviews(db.DefaultContext, issues_model.FindReviewOptions{
|
||||
IssueID: 2,
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
for _, r := range reviews {
|
||||
assert.NoError(t, issues_model.DeleteReview(db.DefaultContext, r))
|
||||
require.NoError(t, issues_model.DeleteReview(db.DefaultContext, r))
|
||||
}
|
||||
ctx.Data["ShowOutdatedComments"] = true
|
||||
renderConversation(ctx, preparedComment, "timeline")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue