File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
import { PostgrestClient } from '../src/index'
2
2
import { Database } from './types.override'
3
+ import { Database as DatabasePostgrest13 } from './types.override-with-options-postgrest13'
3
4
import { expectType } from 'tsd'
4
5
import { InvalidMethodError } from '../src/PostgrestFilterBuilder'
5
6
6
7
const REST_URL_13 = 'http://localhost:3001'
7
- const postgrest13 = new PostgrestClient < Database , { postgrestVersion : 13 } > ( REST_URL_13 )
8
+ const postgrest13 = new PostgrestClient < DatabasePostgrest13 > ( REST_URL_13 )
8
9
const postgrest12 = new PostgrestClient < Database > ( REST_URL_13 )
9
10
10
11
describe ( 'maxAffected' , ( ) => {
@@ -75,7 +76,7 @@ describe('maxAffected', () => {
75
76
. maxAffected ( 2 )
76
77
const { error } = result
77
78
expect ( error ) . toBeDefined ( )
78
- expect ( error ?. message ) . toBe ( 'Query result exceeds max-affected preference constraint ' )
79
+ expect ( error ?. code ) . toBe ( 'PGRST124 ' )
79
80
} )
80
81
81
82
test ( 'update should succeed when within maxAffected limit' , async ( ) => {
@@ -114,7 +115,7 @@ describe('maxAffected', () => {
114
115
. select ( )
115
116
116
117
expect ( error ) . toBeDefined ( )
117
- expect ( error ?. message ) . toBe ( 'Query result exceeds max-affected preference constraint ' )
118
+ expect ( error ?. code ) . toBe ( 'PGRST124 ' )
118
119
} )
119
120
120
121
test ( 'delete should succeed when within maxAffected limit' , async ( ) => {
You can’t perform that action at this time.
0 commit comments