Skip to content

Commit

Permalink
fix: node@14 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
KuznetsovRoman committed Mar 27, 2024
1 parent 4fc421b commit 4875b0f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/test-adapter/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion lib/test-adapter/sqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion lib/test-attempt-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4875b0f

Please sign in to comment.