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

Commit f892424

Browse files
committed
test: update UPSERT calls
1 parent 0593e1a commit f892424

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

test/basic.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ test('switch schema', async () => {
3737
test('on_conflict insert', async () => {
3838
const res = await postgrest
3939
.from('users')
40-
.insert({ username: 'dragarcia' }, { upsert: true, onConflict: 'username' })
40+
.upsert({ username: 'dragarcia' }, { onConflict: 'username' })
4141
expect(res).toMatchSnapshot()
4242
})
4343

@@ -55,7 +55,7 @@ describe('basic insert, update, delete', () => {
5555
test('upsert', async () => {
5656
let res = await postgrest
5757
.from('messages')
58-
.insert({ id: 3, message: 'foo', username: 'supabot', channel_id: 2 }, { upsert: true })
58+
.upsert({ id: 3, message: 'foo', username: 'supabot', channel_id: 2 })
5959
expect(res).toMatchSnapshot()
6060

6161
res = await postgrest.from('messages').select()
@@ -194,10 +194,7 @@ describe("insert, update, delete with count: 'exact'", () => {
194194
test("upsert with count: 'exact'", async () => {
195195
let res = await postgrest
196196
.from('messages')
197-
.insert(
198-
{ id: 3, message: 'foo', username: 'supabot', channel_id: 2 },
199-
{ upsert: true, count: 'exact' }
200-
)
197+
.upsert({ id: 3, message: 'foo', username: 'supabot', channel_id: 2 }, { count: 'exact' })
201198
expect(res).toMatchSnapshot()
202199

203200
res = await postgrest.from('messages').select()

0 commit comments

Comments
 (0)