1
0
Fork 0
mirror of https://github.com/dorny/test-reporter.git synced 2026-03-21 23:52:12 +01:00

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
Failed to extract signature
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}