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

Commit c5524a7

Browse files
committed
test: csv
1 parent 9cc75db commit c5524a7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/transforms.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,25 @@ test('select on stored procedure', async () => {
5656
.select('status')
5757
expect(res).toMatchSnapshot()
5858
})
59+
60+
test('csv', async () => {
61+
const res = await postgrest.from('users').select().csv()
62+
expect(res).toMatchInlineSnapshot(`
63+
Object {
64+
"body": "username,data,age_range,status,catchphrase
65+
supabot,,\\"[1,2)\\",ONLINE,\\"'cat' 'fat'\\"
66+
kiwicopple,,\\"[25,35)\\",OFFLINE,\\"'bat' 'cat'\\"
67+
awailas,,\\"[25,35)\\",ONLINE,\\"'bat' 'rat'\\"
68+
dragarcia,,\\"[20,30)\\",ONLINE,\\"'fat' 'rat'\\"",
69+
"count": null,
70+
"data": "username,data,age_range,status,catchphrase
71+
supabot,,\\"[1,2)\\",ONLINE,\\"'cat' 'fat'\\"
72+
kiwicopple,,\\"[25,35)\\",OFFLINE,\\"'bat' 'cat'\\"
73+
awailas,,\\"[25,35)\\",ONLINE,\\"'bat' 'rat'\\"
74+
dragarcia,,\\"[20,30)\\",ONLINE,\\"'fat' 'rat'\\"",
75+
"error": null,
76+
"status": 200,
77+
"statusText": "OK",
78+
}
79+
`)
80+
})

0 commit comments

Comments
 (0)