diff --git a/src/formatters/junitFormatter.ts b/src/formatters/junitFormatter.ts
index a0ee610205e..7035b2fd945 100644
--- a/src/formatters/junitFormatter.ts
+++ b/src/formatters/junitFormatter.ts
@@ -32,8 +32,8 @@ export class Formatter extends AbstractFormatter {
-
- Missing semicolon
+
+ Missing semicolon Line 1, Column 14
@@ -64,9 +64,12 @@ export class Formatter extends AbstractFormatter {
output += ``;
}
- output += ``;
- output += `${message}`;
+ output += ``;
+ output += `${message} `;
+ output += `Line ${lineAndCharacter.line + 1}, `;
+ output += `Column ${lineAndCharacter.character + 1}`;
+ output += ``;
output += "";
}
if (previousFilename !== null) {
diff --git a/test/formatters/junitFormatterTests.ts b/test/formatters/junitFormatterTests.ts
index 4f1bc6c4a71..04bbcdfe63a 100644
--- a/test/formatters/junitFormatterTests.ts
+++ b/test/formatters/junitFormatterTests.ts
@@ -79,29 +79,28 @@ describe("JUnit Formatter", () => {
"warning",
),
];
-
const expectedResult = `
-
- first failure
+
+ first failure Line 1, Column 1
-
- &<>'" should be escaped
+
+ &<>'" should be escaped Line 1, Column 3
-
- last failure
+
+ last failure Line 6, Column 3
-
- first failure
+
+ first failure Line 1, Column 1
-
- &<>'" should be escaped
+
+ &<>'" should be escaped Line 1, Column 3
-
- last failure
+
+ last failure Line 6, Column 3
`.replace(/>\s+/g, ">"); // Remove whitespace between tags;