mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 14:27:10 +01:00
fix(java-junit): stack trace line can start with whitespaces
Fixes #208
This commit is contained in:
parent
e5edb614dd
commit
3a48f6e045
2 changed files with 10 additions and 1 deletions
|
|
@ -25,6 +25,15 @@ describe('parseStackTraceLine tests', () => {
|
||||||
lineStr: '29'
|
lineStr: '29'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('starts with whitespaces', async () => {
|
||||||
|
const line = " \tat org.apache.pulsar.AddMissingPatchVersionTest.testVersionStrings(AddMissingPatchVersionTest.java:29)"
|
||||||
|
expect(parseStackTraceElement(line)).toEqual({
|
||||||
|
tracePath: "org.apache.pulsar.AddMissingPatchVersionTest.testVersionStrings",
|
||||||
|
fileName: "AddMissingPatchVersionTest.java",
|
||||||
|
lineStr: "29"
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('Kotlin class', () => {
|
describe('Kotlin class', () => {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ export interface StackTraceElement {
|
||||||
|
|
||||||
// simple format:
|
// simple format:
|
||||||
// at <FULLY_QUALIFIED_METHOD_NAME>(<FILE_NAME>:<LINE_NUMBER>)
|
// at <FULLY_QUALIFIED_METHOD_NAME>(<FILE_NAME>:<LINE_NUMBER>)
|
||||||
const re = /^at (.*)\((.*):(\d+)\)$/
|
const re = /^\s*at (.*)\((.*):(\d+)\)$/
|
||||||
|
|
||||||
export function parseStackTraceElement(stackTraceLine: string): StackTraceElement | undefined {
|
export function parseStackTraceElement(stackTraceLine: string): StackTraceElement | undefined {
|
||||||
const match = stackTraceLine.match(re)
|
const match = stackTraceLine.match(re)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue