mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 13:57:09 +01:00
parent
57cb2734c7
commit
c1926959e2
1 changed files with 5 additions and 1 deletions
|
|
@ -37,7 +37,7 @@ export class JestJunitParser implements TestParser {
|
|||
junit.testsuites.testsuite === undefined
|
||||
? []
|
||||
: junit.testsuites.testsuite.map(ts => {
|
||||
const name = ts.$.name.trim()
|
||||
const name = this.escapeCharacters(ts.$.name.trim())
|
||||
const time = parseFloat(ts.$.time) * 1000
|
||||
const sr = new TestSuiteResult(name, this.getGroups(ts), time)
|
||||
return sr
|
||||
|
|
@ -118,4 +118,8 @@ export class JestJunitParser implements TestParser {
|
|||
(this.assumedWorkDir = getBasePath(path, this.options.trackedFiles))
|
||||
)
|
||||
}
|
||||
|
||||
private escapeCharacters(s: string): string {
|
||||
return s.replace(/([<>])/g, '\\$1')
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue