File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -882,10 +882,27 @@ function get() {
882
882
t ( 'Async stack trace' , async ( ) => {
883
883
return [
884
884
parseInt ( new Error ( ) . stack . split ( '\n' ) [ 1 ] . split ( ':' ) [ 1 ] ) + 1 ,
885
- parseInt ( await sql . begin ( sql => sql `select.sql` ) . catch ( x => x . stack . split ( '\n' ) . pop ( ) . split ( ':' ) [ 1 ] ) )
885
+ parseInt ( await sql `select.sql` . catch ( x => x . stack . split ( '\n' ) . pop ( ) . split ( ':' ) [ 1 ] ) )
886
886
]
887
887
} )
888
888
889
+ t ( 'Debug has long async stack trace' , async ( ) => {
890
+ const sql = postgres ( { debug : true } )
891
+
892
+ return [
893
+ 'watyo' ,
894
+ await yo ( ) . catch ( x => x . stack . match ( / w a t | y o / g) . join ( '' ) )
895
+ ]
896
+
897
+ function yo ( ) {
898
+ return wat ( )
899
+ }
900
+
901
+ function wat ( ) {
902
+ return sql `selec 1`
903
+ }
904
+ } )
905
+
889
906
t ( 'Error contains query string' , async ( ) => [
890
907
'selec 1' ,
891
908
( await sql `selec 1` . catch ( err => err . query ) )
You can’t perform that action at this time.
0 commit comments