1
0
Fork 0

core: Add return type to test helper function

pull/1696/head
James M. Greene 2024-03-28 10:38:51 -05:00
parent bd74802644
commit 6c5b20a89f
1 changed files with 5 additions and 1 deletions

View File

@ -49,7 +49,11 @@ const testEnvVars = {
const UUID = '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' const UUID = '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
const DELIMITER = `ghadelimiter_${UUID}` const DELIMITER = `ghadelimiter_${UUID}`
function extractErrorMetadata(error: Error) { function extractErrorMetadata(error: Error): {
file: string | undefined
line: string | undefined
column: string | undefined
} {
const stackLines = error.stack?.split(os.EOL) || [] const stackLines = error.stack?.split(os.EOL) || []
const firstTraceLine = stackLines[1] const firstTraceLine = stackLines[1]
const match = firstTraceLine.match(/at (?:.*) \((.*):(\d+):(\d+)\)/) || [] const match = firstTraceLine.match(/at (?:.*) \((.*):(\d+):(\d+)\)/) || []