File tree Expand file tree Collapse file tree
dev-packages/e2e-tests/test-applications Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,7 +128,9 @@ test.describe('database integration', () => {
128128
129129 test ( 'captures database error and marks span as failed' , async ( { request } ) => {
130130 const errorPromise = waitForError ( 'nuxt-3' , errorEvent => {
131- return ! ! errorEvent ?. exception ?. values ?. [ 0 ] ?. value ?. includes ( 'no such table' ) ;
131+ return ! ! errorEvent ?. exception ?. values ?. some (
132+ value => value . mechanism ?. type === 'auto.db.nuxt' && value . value ?. includes ( 'no such table' ) ,
133+ ) ;
132134 } ) ;
133135
134136 const transactionPromise = waitForTransaction ( 'nuxt-3' , transactionEvent => {
@@ -141,9 +143,11 @@ test.describe('database integration', () => {
141143
142144 const [ error , transaction ] = await Promise . all ( [ errorPromise , transactionPromise ] ) ;
143145
144- expect ( error ) . toBeDefined ( ) ;
145- expect ( error . exception ?. values ?. [ 0 ] ?. value ) . toContain ( 'no such table' ) ;
146- expect ( error . exception ?. values ?. [ 0 ] ?. mechanism ) . toEqual ( {
146+ const dbException = error . exception ?. values ?. find ( value => value . mechanism ?. type === 'auto.db.nuxt' ) ;
147+
148+ expect ( dbException ) . toBeDefined ( ) ;
149+ expect ( dbException ?. value ) . toContain ( 'no such table' ) ;
150+ expect ( dbException ?. mechanism ) . toEqual ( {
147151 handled : false ,
148152 type : 'auto.db.nuxt' ,
149153 } ) ;
Original file line number Diff line number Diff line change @@ -128,7 +128,9 @@ test.describe('database integration', () => {
128128
129129 test ( 'captures database error and marks span as failed' , async ( { request } ) => {
130130 const errorPromise = waitForError ( 'nuxt-4' , errorEvent => {
131- return ! ! errorEvent ?. exception ?. values ?. [ 0 ] ?. value ?. includes ( 'no such table' ) ;
131+ return ! ! errorEvent ?. exception ?. values ?. some (
132+ value => value . mechanism ?. type === 'auto.db.nuxt' && value . value ?. includes ( 'no such table' ) ,
133+ ) ;
132134 } ) ;
133135
134136 const transactionPromise = waitForTransaction ( 'nuxt-4' , transactionEvent => {
@@ -141,9 +143,11 @@ test.describe('database integration', () => {
141143
142144 const [ error , transaction ] = await Promise . all ( [ errorPromise , transactionPromise ] ) ;
143145
144- expect ( error ) . toBeDefined ( ) ;
145- expect ( error . exception ?. values ?. [ 0 ] ?. value ) . toContain ( 'no such table' ) ;
146- expect ( error . exception ?. values ?. [ 0 ] ?. mechanism ) . toEqual ( {
146+ const dbException = error . exception ?. values ?. find ( value => value . mechanism ?. type === 'auto.db.nuxt' ) ;
147+
148+ expect ( dbException ) . toBeDefined ( ) ;
149+ expect ( dbException ?. value ) . toContain ( 'no such table' ) ;
150+ expect ( dbException ?. mechanism ) . toEqual ( {
147151 handled : false ,
148152 type : 'auto.db.nuxt' ,
149153 } ) ;
Original file line number Diff line number Diff line change @@ -128,7 +128,9 @@ test.describe('database integration', () => {
128128
129129 test ( 'captures database error and marks span as failed' , async ( { request } ) => {
130130 const errorPromise = waitForError ( 'nuxt-5' , errorEvent => {
131- return ! ! errorEvent ?. exception ?. values ?. [ 0 ] ?. value ?. includes ( 'no such table' ) ;
131+ return ! ! errorEvent ?. exception ?. values ?. some (
132+ value => value . mechanism ?. type === 'auto.db.nuxt' && value . value ?. includes ( 'no such table' ) ,
133+ ) ;
132134 } ) ;
133135
134136 const transactionPromise = waitForTransaction ( 'nuxt-5' , transactionEvent => {
@@ -141,9 +143,11 @@ test.describe('database integration', () => {
141143
142144 const [ error , transaction ] = await Promise . all ( [ errorPromise , transactionPromise ] ) ;
143145
144- expect ( error ) . toBeDefined ( ) ;
145- expect ( error . exception ?. values ?. [ 0 ] ?. value ) . toContain ( 'no such table' ) ;
146- expect ( error . exception ?. values ?. [ 0 ] ?. mechanism ) . toEqual ( {
146+ const dbException = error . exception ?. values ?. find ( value => value . mechanism ?. type === 'auto.db.nuxt' ) ;
147+
148+ expect ( dbException ) . toBeDefined ( ) ;
149+ expect ( dbException ?. value ) . toContain ( 'no such table' ) ;
150+ expect ( dbException ?. mechanism ) . toEqual ( {
147151 handled : false ,
148152 type : 'auto.db.nuxt' ,
149153 } ) ;
You can’t perform that action at this time.
0 commit comments