1package migrate
2
3import (
4 "context"
5 "testing"
6
7 "github.com/charmbracelet/soft-serve/pkg/config"
8 "github.com/charmbracelet/soft-serve/pkg/db/internal/test"
9)
10
11func TestMigrate(t *testing.T) {
12 // XXX: we need a config.Config in the context for the migrations to run
13 // properly. Some migrations depend on the config being present.
14 ctx := config.WithContext(context.TODO(), config.DefaultConfig())
15 dbx, err := test.OpenSqlite(ctx, t)
16 if err != nil {
17 t.Fatal(err)
18 }
19 if err := Migrate(ctx, dbx); err != nil {
20 t.Errorf("Migrate() => %v, want nil error", err)
21 }
22}