Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Commit 1e00cbc

Browse files
committed
test: update with no match
1 parent cc25705 commit 1e00cbc

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/basic.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,3 +423,29 @@ test('select with no match', async () => {
423423
}
424424
`)
425425
})
426+
427+
test('update with no match - return=minimal', async () => {
428+
const res = await postgrest.from('users').update({ data: '' }).eq('username', 'missing')
429+
expect(res).toMatchInlineSnapshot(`
430+
Object {
431+
"count": null,
432+
"data": null,
433+
"error": null,
434+
"status": 204,
435+
"statusText": "No Content",
436+
}
437+
`)
438+
})
439+
440+
test('update with no match - return=representation', async () => {
441+
const res = await postgrest.from('users').update({ data: '' }).eq('username', 'missing').select()
442+
expect(res).toMatchInlineSnapshot(`
443+
Object {
444+
"count": null,
445+
"data": Array [],
446+
"error": null,
447+
"status": 200,
448+
"statusText": "OK",
449+
}
450+
`)
451+
})

0 commit comments

Comments
 (0)