Skip to content

Commit a479b87

Browse files
committed
fix: add runtime test coverage
1 parent 950a6ff commit a479b87

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/basic.ts

+24
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,30 @@ test('basic select returns types override', async () => {
116116
`)
117117
})
118118

119+
test('basic select returns from builder', async () => {
120+
const res = await postgrest
121+
.from('users')
122+
.select()
123+
.eq('username', 'supabot')
124+
.single()
125+
.returns<{ status: 'ONLINE' | 'OFFLINE' }>()
126+
expect(res).toMatchInlineSnapshot(`
127+
Object {
128+
"count": null,
129+
"data": Object {
130+
"age_range": "[1,2)",
131+
"catchphrase": "'cat' 'fat'",
132+
"data": null,
133+
"status": "ONLINE",
134+
"username": "supabot",
135+
},
136+
"error": null,
137+
"status": 200,
138+
"statusText": "OK",
139+
}
140+
`)
141+
})
142+
119143
test('basic select view', async () => {
120144
const res = await postgrest.from('updatable_view').select()
121145
expect(res).toMatchInlineSnapshot(`

0 commit comments

Comments
 (0)