metaltest/lib/stackparser.js

9 lines
268 B
JavaScript

const regAssertParser = /(?<title>.*?)\n+(?<diff>.*?)\n+(?<stacktrace> (?<where>at.*?file:\/\/(?<file>.*?):(?<line>\d+):(?<column>\d+)\)?)\n.*)/s
const stackParser = (stack) => {
const m = stack.match(regAssertParser)
return m.groups
}
export { stackParser }