This repository was archived by the owner on Oct 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +28
-9
lines changed Expand file tree Collapse file tree 2 files changed +28
-9
lines changed Original file line number Diff line number Diff line change @@ -277,3 +277,17 @@ test('insert w/ empty body has no columns param', async () => {
277
277
const client = postgrest . from ( 'users' ) . insert ( [ { } , { } ] )
278
278
expect ( ( client as any ) . url . searchParams . has ( 'columns' ) ) . toBeFalsy ( )
279
279
} )
280
+
281
+ test ( 'select with no match' , async ( ) => {
282
+ const res = await postgrest . from ( 'users' ) . select ( ) . eq ( 'username' , 'missing' )
283
+ expect ( res ) . toMatchInlineSnapshot ( `
284
+ Object {
285
+ "body": Array [],
286
+ "count": null,
287
+ "data": Array [],
288
+ "error": null,
289
+ "status": 200,
290
+ "statusText": "OK",
291
+ }
292
+ ` )
293
+ } )
Original file line number Diff line number Diff line change @@ -128,18 +128,23 @@ test('neq', async () => {
128
128
} )
129
129
130
130
test ( 'gt' , async ( ) => {
131
- const res = await postgrest . from ( 'messages' ) . select ( '' ) . gt ( 'id' , 1 )
131
+ const res = await postgrest . from ( 'messages' ) . select ( 'id ' ) . gt ( 'id' , 1 )
132
132
expect ( res ) . toMatchInlineSnapshot ( `
133
133
Object {
134
- "body": null,
134
+ "body": Array [
135
+ Object {
136
+ "id": 2,
137
+ },
138
+ ],
135
139
"count": null,
136
- "data": null,
137
- "error": Object {
138
- "details": "unexpected end of input expecting field name (* or [a..z0..9_]) or \\"*\\"",
139
- "message": "\\"failed to parse select parameter ()\\" (line 1, column 1)",
140
- },
141
- "status": 400,
142
- "statusText": "Bad Request",
140
+ "data": Array [
141
+ Object {
142
+ "id": 2,
143
+ },
144
+ ],
145
+ "error": null,
146
+ "status": 200,
147
+ "statusText": "OK",
143
148
}
144
149
` )
145
150
} )
You can’t perform that action at this time.
0 commit comments