Setup test logging

This commit is contained in:
2024-12-19 23:42:19 +01:00
parent cf2e1809a4
commit f0b6aa0d6e
20 changed files with 33 additions and 9 deletions

View File

@@ -5,6 +5,8 @@ import (
"novamd/internal/db"
_ "novamd/internal/testenv"
_ "github.com/mattn/go-sqlite3"
)

View File

@@ -7,6 +7,7 @@ import (
"novamd/internal/db"
"novamd/internal/models"
_ "novamd/internal/testenv"
"github.com/google/uuid"
)

View File

@@ -9,6 +9,7 @@ import (
"novamd/internal/db"
"novamd/internal/models"
_ "novamd/internal/testenv"
"github.com/google/uuid"
)

View File

@@ -6,6 +6,7 @@ import (
"novamd/internal/db"
"novamd/internal/models"
_ "novamd/internal/testenv"
)
func TestUserOperations(t *testing.T) {

View File

@@ -1,12 +1,12 @@
package db_test
import (
"database/sql"
"strings"
"testing"
"novamd/internal/db"
"novamd/internal/models"
_ "novamd/internal/testenv"
)
func TestWorkspaceOperations(t *testing.T) {
@@ -385,8 +385,8 @@ func TestWorkspaceOperations(t *testing.T) {
// Verify workspace is gone
_, err = database.GetWorkspaceByID(workspace.ID)
if err != sql.ErrNoRows {
t.Errorf("expected sql.ErrNoRows, got %v", err)
if !strings.Contains(err.Error(), "workspace not found") {
t.Errorf("expected workspace not found, got %v", err)
}
})
}