@@ -67,7 +67,7 @@ function buildSource(source) {
67
67
} ;
68
68
}
69
69
70
- function trySerializeError ( error , shouldBeautifyStack , testFile ) {
70
+ function trySerializeError ( error , shouldBeautifyStack , testFile , testLine ) {
71
71
const stack = error . savedError ? error . savedError . stack : error . stack ;
72
72
73
73
const retval = {
@@ -82,6 +82,8 @@ function trySerializeError(error, shouldBeautifyStack, testFile) {
82
82
retval . stack = error . actualStack ;
83
83
}
84
84
85
+ retval . stack += `\n${ testLine } ` ;
86
+
85
87
if ( retval . avaAssertionError ) {
86
88
retval . improperUsage = error . improperUsage ;
87
89
retval . message = error . message ;
@@ -143,7 +145,7 @@ function trySerializeError(error, shouldBeautifyStack, testFile) {
143
145
return retval ;
144
146
}
145
147
146
- function serializeError ( origin , shouldBeautifyStack , error , testFile ) {
148
+ function serializeError ( origin , shouldBeautifyStack , error , testFile , testLine ) {
147
149
if ( ! isError ( error ) ) {
148
150
return {
149
151
avaAssertionError : false ,
@@ -153,7 +155,7 @@ function serializeError(origin, shouldBeautifyStack, error, testFile) {
153
155
}
154
156
155
157
try {
156
- return trySerializeError ( error , shouldBeautifyStack , testFile ) ;
158
+ return trySerializeError ( error , shouldBeautifyStack , testFile , testLine ) ;
157
159
} catch {
158
160
const replacement = new Error ( `${ origin } : Could not serialize error` ) ;
159
161
return {
0 commit comments