Skip to content

Commit

Permalink
fix: runtime failure when using es2024 features
Browse files Browse the repository at this point in the history
  • Loading branch information
Codex- committed Oct 2, 2024
1 parent 80bebd0 commit 854b949
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@eslint/compat": "^1.1.1",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.11.1",
"@opentf/std": "^0.13.0",
"@total-typescript/ts-reset": "^0.6.1",
"@types/eslint__js": "^8.42.3",
"@types/node": "^22.7.4",
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/return-dispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as core from "@actions/core";
import { ActionOutputs, type ActionConfig } from "./action.ts";
import * as api from "./api.ts";
import * as constants from "./constants.ts";
import { getBranchName, type BranchNameResult } from "./utils.ts";
import { type BranchNameResult } from "./utils.ts";

export function shouldRetryOrThrow(
error: Error,
Expand Down
6 changes: 5 additions & 1 deletion src/test-utils/logging.mock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as core from "@actions/core";
import { symDiff } from "@opentf/std";
import { type MockInstance, vi, expect } from "vitest";

// Consuming test suites must first call:
Expand Down Expand Up @@ -63,7 +64,10 @@ function assertOnlyCalledInner(
);
}

const diff = coreLogMockSet.symmetricDifference(new Set(coreLogMocks));
// Once Node 22 is LTS, this can be:
// const diff = coreLogMockSet.symmetricDifference(new Set(coreLogMocks));

const diff = symDiff([[...coreLogMockSet], coreLogMocks]);

for (const logMock of diff) {
expect(logMock).not.toHaveBeenCalled();
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "esnext",
"target": "es2023",
"module": "nodenext",
"noEmit": true,

Expand Down

0 comments on commit 854b949

Please sign in to comment.