File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,30 @@ test('basic select returns types override', async () => {
116
116
` )
117
117
} )
118
118
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
+
119
143
test ( 'basic select view' , async ( ) => {
120
144
const res = await postgrest . from ( 'updatable_view' ) . select ( )
121
145
expect ( res ) . toMatchInlineSnapshot ( `
You can’t perform that action at this time.
0 commit comments