File tree Expand file tree Collapse file tree 5 files changed +6
-4
lines changed
packages/vitest/src/node/reporters Expand file tree Collapse file tree 5 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ export class JUnitReporter implements Reporter {
131131 for ( const frame of stack ) {
132132 const path = relative ( this . ctx . config . root , frame . file )
133133
134- await this . baseLog ( ` ${ F_POINTER } ${ [ frame . method , `${ path } :${ frame . line } :${ frame . column } ` ] . filter ( Boolean ) . join ( ' ' ) } ` )
134+ await this . baseLog ( escapeXML ( ` ${ F_POINTER } ${ [ frame . method , `${ path } :${ frame . line } :${ frame . column } ` ] . filter ( Boolean ) . join ( ' ' ) } ` ) )
135135
136136 // reached at test file, skip the follow stack
137137 if ( frame . file in this . ctx . state . filesMap )
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ function createSuiteHavingFailedTestWithXmlInError(): File[] {
2828
2929 errorWithXml . stack = 'Error: error message that has XML in it <tag>\n'
3030 + ' at /vitest/test/core/test/basic.test.ts:8:32\n'
31+ + ' at /vitest/test/core/test/<bracket-name>.ts:3:11\n'
3132 + ' at etc....'
3233
3334 const tasks : Task [ ] = [
Original file line number Diff line number Diff line change 1- // Vitest Snapshot v1
1+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22
33exports [` html reporter > resolves to "failing" status for test file "json-fail" > tests are failing 1` ] = `
44{
Original file line number Diff line number Diff line change 1- // Vitest Snapshot v1
1+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22
33exports [` json reporter > generates correct report 1` ] = `
44{
Original file line number Diff line number Diff line change 1- // Vitest Snapshot v1
1+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22
33exports [` JUnit reporter (no outputFile entry) 1` ] = `
44"<?xml version=\\ "1.0\\ " encoding=\\ "UTF-8\\ " ?>
@@ -249,6 +249,7 @@ exports[`JUnit reporter with outputFile with XML in error message 2`] = `
249249 <failure message =\\"error message that has XML in it <tag>\\" type =\\"AssertionError\\">
250250AssertionError: error message that has XML in it <tag>
251251 ❯ test/core/test/basic.test.ts:8:32
252+ ❯ test/core/test/<bracket-name>.ts:3:11
252253 </failure>
253254 </testcase>
254255 </testsuite>
You can’t perform that action at this time.
0 commit comments