Skip to content

Commit

Permalink
chore: add more runtime tests coverage for selection
Browse files Browse the repository at this point in the history
create tests cases to assert postgrest runtime behavior across large
typology of queries. Prepare for future testing against result infered types
  • Loading branch information
avallete committed Sep 27, 2024
1 parent 5ea6d90 commit df9274e
Show file tree
Hide file tree
Showing 3 changed files with 1,717 additions and 19 deletions.
19 changes: 0 additions & 19 deletions test/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,25 +113,6 @@ const postgrest = new PostgrestClient<Database>(REST_URL)
expectType<string>(data.baz)
}

// typecasting and aggregate functions
{
const { data, error } = await postgrest
.from('messages')
.select(
'message, users.count(), casted_message:message::int4, casted_count:users.count()::text'
)
.single()
if (error) {
throw new Error(error.message)
}
expectType<{
message: string | null
count: number
casted_message: number
casted_count: string
}>(data)
}

// rpc return type
{
const { data, error } = await postgrest.rpc('get_status')
Expand Down
1 change: 1 addition & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import './basic'
import './relationships'
import './filters'
import './resource-embedding'
import './transforms'
Loading

0 comments on commit df9274e

Please sign in to comment.