Skip to content

Commit

Permalink
chore: update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatybridge committed Jan 31, 2025
1 parent 9e2a740 commit 84d4210
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion internal/db/diff/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ func TestDiffDatabase(t *testing.T) {
// Check error
assert.Empty(t, diff)
assert.ErrorContains(t, err, `ERROR: schema "public" already exists (SQLSTATE 42P06)
At statement 0: create schema public`)
At statement 0:
create schema public`)
assert.Empty(t, apitest.ListUnmatchedRequests())
})

Expand Down
2 changes: 1 addition & 1 deletion internal/db/push/push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestMigrationPush(t *testing.T) {
err := Run(context.Background(), false, false, false, false, dbConfig, fsys, conn.Intercept)
// Check error
assert.ErrorContains(t, err, `ERROR: null value in column "version" of relation "schema_migrations" (SQLSTATE 23502)`)
assert.ErrorContains(t, err, "At statement 0: "+migration.INSERT_MIGRATION_VERSION)
assert.ErrorContains(t, err, "At statement 0:\n"+migration.INSERT_MIGRATION_VERSION)
})
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/migration/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ func TestMigrationFile(t *testing.T) {
err := migration.ExecBatch(context.Background(), conn.MockClient(t))
// Check error
assert.ErrorContains(t, err, "ERROR: schema \"public\" already exists (SQLSTATE 42P06)")
assert.ErrorContains(t, err, "At statement 0: create schema public")
assert.ErrorContains(t, err, "At statement 0:\ncreate schema public")
})
}

0 comments on commit 84d4210

Please sign in to comment.