Skip to content

Commit f66f056

Browse files
authored
Merge branch 'master' into avallete/chore-increase-runtime-tests-coverage
2 parents df9274e + 981fa4d commit f66f056

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,28 @@ import PostgrestQueryBuilder from './PostgrestQueryBuilder'
44
import PostgrestFilterBuilder from './PostgrestFilterBuilder'
55
import PostgrestTransformBuilder from './PostgrestTransformBuilder'
66
import PostgrestBuilder from './PostgrestBuilder'
7+
import PostgrestError from './PostgrestError'
78

89
export {
910
PostgrestClient,
1011
PostgrestQueryBuilder,
1112
PostgrestFilterBuilder,
1213
PostgrestTransformBuilder,
1314
PostgrestBuilder,
15+
PostgrestError,
1416
}
1517
export default {
1618
PostgrestClient,
1719
PostgrestQueryBuilder,
1820
PostgrestFilterBuilder,
1921
PostgrestTransformBuilder,
2022
PostgrestBuilder,
23+
PostgrestError,
2124
}
2225
export type {
2326
PostgrestResponse,
2427
PostgrestResponseFailure,
2528
PostgrestResponseSuccess,
2629
PostgrestSingleResponse,
2730
PostgrestMaybeSingleResponse,
28-
PostgrestError,
2931
} from './types'

test/basic.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,15 +1355,21 @@ describe("insert, update, delete with count: 'exact'", () => {
13551355
expect(res).toMatchInlineSnapshot(`
13561356
Object {
13571357
"count": null,
1358-
"data": null,
1359-
"error": Object {
1360-
"code": "23505",
1361-
"details": "Key (id)=(2) already exists.",
1362-
"hint": null,
1363-
"message": "duplicate key value violates unique constraint \\"channels_pkey\\"",
1364-
},
1365-
"status": 409,
1366-
"statusText": "Conflict",
1358+
"data": Array [
1359+
Object {
1360+
"data": null,
1361+
"id": 100,
1362+
"slug": null,
1363+
},
1364+
Object {
1365+
"data": null,
1366+
"id": 5,
1367+
"slug": "test-slug",
1368+
},
1369+
],
1370+
"error": null,
1371+
"status": 201,
1372+
"statusText": "Created",
13671373
}
13681374
`)
13691375
})
@@ -1385,7 +1391,7 @@ describe("insert, update, delete with count: 'exact'", () => {
13851391
},
13861392
Object {
13871393
"data": null,
1388-
"id": 4,
1394+
"id": 7,
13891395
"slug": "test-slug",
13901396
},
13911397
],

test/db/01-dummy-data.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ VALUES
88
('jsonuser', 'ONLINE', '[20,30)'::int4range, 'json test'::tsvector, '{"foo": {"bar": {"nested": "value"}, "baz": "string value"}}'::jsonb);
99

1010
INSERT INTO
11-
public.channels (id, slug)
11+
public.channels (slug)
1212
VALUES
13-
(1, 'public'),
14-
(2, 'random'),
15-
(3, 'other');
13+
('public'),
14+
('random'),
15+
('other');
1616

1717
INSERT INTO
1818
public.messages (message, channel_id, username)

0 commit comments

Comments
 (0)