diff --git a/lib/test-adapter/reporter.ts b/lib/test-adapter/reporter.ts index bcd0ac593..d0a68380c 100644 --- a/lib/test-adapter/reporter.ts +++ b/lib/test-adapter/reporter.ts @@ -89,7 +89,7 @@ export class ReporterTestAdapter implements ReporterTestResult { } get state(): {name: string;} { - return {name: this.testPath.at(-1) as string}; + return {name: this.testPath[this.testPath.length - 1]}; } get status(): TestStatus { diff --git a/lib/test-adapter/sqlite.ts b/lib/test-adapter/sqlite.ts index 658ba3ee7..4e12d0757 100644 --- a/lib/test-adapter/sqlite.ts +++ b/lib/test-adapter/sqlite.ts @@ -135,7 +135,7 @@ export class SqliteTestAdapter implements ReporterTestResult { } get state(): { name: string; } { - return {name: this.testPath.at(-1) as string}; + return {name: this.testPath[this.testPath.length - 1]}; } get status(): TestStatus { diff --git a/lib/test-attempt-manager.ts b/lib/test-attempt-manager.ts index 2b65263e5..009ce4185 100644 --- a/lib/test-attempt-manager.ts +++ b/lib/test-attempt-manager.ts @@ -36,7 +36,7 @@ export class TestAttemptManager { const [hash, data] = this._getData(testResult); const isManualOverride = index !== null; - const isLastStatusTemporary = [IDLE, RUNNING].includes(data.statuses.at(-1) as TestStatus); + const isLastStatusTemporary = [IDLE, RUNNING].includes(data.statuses[data.statuses.length - 1]); const shouldReplace = Number(isManualOverride || isLastStatusTemporary); data.statuses.splice(index ?? data.statuses.length - shouldReplace, shouldReplace, status);