Skip to content

Commit

Permalink
fix tests for update implementation of ReadREADME
Browse files Browse the repository at this point in the history
  • Loading branch information
theredditbandit committed May 20, 2024
1 parent 38649d7 commit 914be59
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/utils/utils_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package utils_test

import (
"fmt"
"os"
"testing"
"time"
Expand Down Expand Up @@ -181,7 +182,7 @@ func Test_ReadREADME(t *testing.T) {
})

t.Run("Test ReadREADME with invalid README file name", func(t *testing.T) {
expected := []byte(nil)
expected := []byte(fmt.Sprintf("# README does not exist for %s", projectName))

t.Cleanup(func() {
err := db.DeleteDb(dbname)
Expand All @@ -201,7 +202,7 @@ func Test_ReadREADME(t *testing.T) {
actual, err := utils.ReadREADME(dbname, projectName)

assert.Equal(t, expected, actual)
require.ErrorIs(t, err, utils.ErrReadREADME)
require.NoError(t, err)
})
}

Expand Down

0 comments on commit 914be59

Please sign in to comment.