Skip to content

Commit 6efb86e

Browse files
authored
Merge pull request #704 from dorny/bugfix/703-refactor-deprecated-substr-function
2 parents ff2d13c + 055bc8c commit 6efb86e

File tree

10 files changed

+24
-24
lines changed

10 files changed

+24
-24
lines changed

dist/index.js

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/parsers/dart-json/dart-json-parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,13 @@ export class DartJsonParser implements TestParser {
242242
private getRelativePath(path: string): string {
243243
const prefix = 'file://'
244244
if (path.startsWith(prefix)) {
245-
path = path.substr(prefix.length)
245+
path = path.substring(prefix.length)
246246
}
247247

248248
path = normalizeFilePath(path)
249249
const workDir = this.getWorkDir(path)
250250
if (workDir !== undefined && path.startsWith(workDir)) {
251-
path = path.substr(workDir.length)
251+
path = path.substring(workDir.length)
252252
}
253253
return path
254254
}

src/parsers/dotnet-nunit/dotnet-nunit-parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class DotnetNunitParser implements TestParser {
136136
path = normalizeFilePath(path)
137137
const workDir = this.getWorkDir(path)
138138
if (workDir !== undefined && path.startsWith(workDir)) {
139-
path = path.substr(workDir.length)
139+
path = path.substring(workDir.length)
140140
}
141141
return path
142142
}

src/parsers/dotnet-trx/dotnet-trx-parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class DotnetTrxParser implements TestParser {
9494
const resultTestName = r.result.$.testName
9595
const testName =
9696
resultTestName.startsWith(className) && resultTestName[className.length] === '.'
97-
? resultTestName.substr(className.length + 1)
97+
? resultTestName.substring(className.length + 1)
9898
: resultTestName
9999

100100
const test = new Test(testName, r.result.$.outcome, duration, error)
@@ -177,7 +177,7 @@ export class DotnetTrxParser implements TestParser {
177177
const filePath = normalizeFilePath(fileStr)
178178
const workDir = this.getWorkDir(filePath)
179179
if (workDir) {
180-
const file = filePath.substr(workDir.length)
180+
const file = filePath.substring(workDir.length)
181181
if (trackedFiles.includes(file)) {
182182
const line = parseInt(lineStr)
183183
return {path: file, line}

src/parsers/jest-junit/jest-junit-parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class JestJunitParser implements TestParser {
106106
path = normalizeFilePath(path)
107107
const workDir = this.getWorkDir(path)
108108
if (workDir !== undefined && path.startsWith(workDir)) {
109-
path = path.substr(workDir.length)
109+
path = path.substring(workDir.length)
110110
}
111111
return path
112112
}

src/parsers/mocha-json/mocha-json-parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class MochaJsonParser implements TestParser {
6161
private processTest(suite: TestSuiteResult, test: MochaJsonTest, result: TestExecutionResult): void {
6262
const groupName =
6363
test.fullTitle !== test.title
64-
? test.fullTitle.substr(0, test.fullTitle.length - test.title.length).trimEnd()
64+
? test.fullTitle.substring(0, test.fullTitle.length - test.title.length).trimEnd()
6565
: null
6666

6767
let group = suite.groups.find(grp => grp.name === groupName)
@@ -103,7 +103,7 @@ export class MochaJsonParser implements TestParser {
103103
path = normalizeFilePath(path)
104104
const workDir = this.getWorkDir(path)
105105
if (workDir !== undefined && path.startsWith(workDir)) {
106-
path = path.substr(workDir.length)
106+
path = path.substring(workDir.length)
107107
}
108108
return path
109109
}

src/parsers/phpunit-junit/phpunit-junit-parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export class PhpunitJunitParser implements TestParser {
208208
path = normalizeFilePath(path)
209209
const workDir = this.getWorkDir(path)
210210
if (workDir !== undefined && path.startsWith(workDir)) {
211-
path = path.substr(workDir.length)
211+
path = path.substring(workDir.length)
212212
}
213213
return path
214214
}

src/parsers/rspec-json/rspec-json-parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class RspecJsonParser implements TestParser {
5555
private processTest(suite: TestSuiteResult, test: RspecExample, result: TestExecutionResult): void {
5656
const groupName =
5757
test.full_description !== test.description
58-
? test.full_description.substr(0, test.full_description.length - test.description.length).trimEnd()
58+
? test.full_description.substring(0, test.full_description.length - test.description.length).trimEnd()
5959
: null
6060

6161
let group = suite.groups.find(grp => grp.name === groupName)

src/utils/markdown-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function ellipsis(text: string, maxLength: number): string {
3636
return text
3737
}
3838

39-
return text.substr(0, maxLength - 3) + '...'
39+
return text.substring(0, maxLength - 3) + '...'
4040
}
4141

4242
export function formatTime(ms: number): string {

src/utils/path-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ export function getBasePath(path: string, trackedFiles: string[]): string | unde
3434
return undefined
3535
}
3636

37-
const base = path.substr(0, path.length - max.length)
37+
const base = path.substring(0, path.length - max.length)
3838
return base
3939
}

0 commit comments

Comments
 (0)