Use String.substring() function instead of the deprecated String.substr()

This commit is contained in:
Jozef Izso
2025-12-29 15:06:16 +01:00
parent ff2d13cc36
commit 17c900ba4e
9 changed files with 12 additions and 12 deletions

View File

@@ -94,7 +94,7 @@ export class DotnetTrxParser implements TestParser {
const resultTestName = r.result.$.testName
const testName =
resultTestName.startsWith(className) && resultTestName[className.length] === '.'
? resultTestName.substr(className.length + 1)
? resultTestName.substring(className.length + 1)
: resultTestName
const test = new Test(testName, r.result.$.outcome, duration, error)
@@ -177,7 +177,7 @@ export class DotnetTrxParser implements TestParser {
const filePath = normalizeFilePath(fileStr)
const workDir = this.getWorkDir(filePath)
if (workDir) {
const file = filePath.substr(workDir.length)
const file = filePath.substring(workDir.length)
if (trackedFiles.includes(file)) {
const line = parseInt(lineStr)
return {path: file, line}