Skip to content

fix(test): remove duplicate taskToIssuePayload import#36

Merged
Arthur742Ramos merged 1 commit into
mainfrom
arthur742ramos/fix-duplicate-import
May 15, 2026
Merged

fix(test): remove duplicate taskToIssuePayload import#36
Arthur742Ramos merged 1 commit into
mainfrom
arthur742ramos/fix-duplicate-import

Conversation

@Arthur742Ramos

Copy link
Copy Markdown
Owner

Why

test/issues-coverage.test.ts imports taskToIssuePayload twice — once at the top of the file, once mid-file alongside generateIssuePreview:

// Top of file (line 2)
import { createIssuesFromTasks, taskToIssuePayload } from "../src/issues.js";

// ...

// Mid-file (line 74)
import { taskToIssuePayload, generateIssuePreview } from "../src/issues.js";

The current esbuild/vitest pinned in main tolerates this silently. Stricter versions reject it as a parse error:

[PARSE_ERROR] Error: Identifier `taskToIssuePayload` has already been declared

This already blocks the open Dependabot dev-dependencies bump (#28), where the new esbuild/vitest combo surfaces it as a hard CI failure on Node 22. Will also block any future major bump of esbuild, vitest, or @vitest/coverage-v8.

What changes

Consolidate to a single top-of-file import that includes generateIssuePreview. Drop the redundant mid-file import.

-import { createIssuesFromTasks, taskToIssuePayload } from "../src/issues.js";
+import { createIssuesFromTasks, generateIssuePreview, taskToIssuePayload } from "../src/issues.js";

-// Additional branch coverage for issues.ts
-import { taskToIssuePayload, generateIssuePreview } from "../src/issues.js";
+// Additional branch coverage for issues.ts (using imports declared at the top)

Validation

  • 11/11 tests in the affected file pass.
  • 985/985 unit tests pass overall.
  • typecheck, lint clean.

No behavior change — same symbols are imported from the same module, just deduplicated.

Follow-up

Once this lands, I'll trigger a Dependabot rebase on #28 (dev-deps bump). With this fix in place, the bump should go from FAILURE to CLEAN.

`test/issues-coverage.test.ts` imports `taskToIssuePayload` twice: once at the top of the file, once mid-file (line 74) alongside `generateIssuePreview`.

The current esbuild/vitest combination silently tolerates the duplicate, but stricter versions reject it as a parse error (`Identifier 'taskToIssuePayload' has already been declared`). This already blocks the open Dependabot dev-dependencies bump (#28), and would block any future major version of esbuild, vitest, or @vitest/coverage-v8.

Fix: consolidate to a single top-of-file import that includes `generateIssuePreview`, and drop the redundant mid-file import. No behavior change — same symbols, same tests still passing (11/11 in the affected file; 985/985 overall).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Arthur742Ramos Arthur742Ramos merged commit 00fe91b into main May 15, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⚔