Skip to content

Fix hardcoded absolute paths and missing mock in JS tests#7432

Merged
pelikhan merged 2 commits intomainfrom
copilot/format-lint-fix-js-tests
Dec 23, 2025
Merged

Fix hardcoded absolute paths and missing mock in JS tests#7432
pelikhan merged 2 commits intomainfrom
copilot/format-lint-fix-js-tests

Conversation

Copy link
Contributor

Copilot AI commented Dec 23, 2025

JavaScript tests were failing due to hardcoded /tmp/gh-aw/actions/ paths breaking TypeScript compilation and incomplete test mocks missing the addHeading method.

Changes

  • Fixed require paths in JS modules: Replaced absolute /tmp/gh-aw/actions/ paths with relative ./ imports in add_comment.cjs and noop.cjs
  • Fixed test mock: Added missing addHeading method to core.summary mock in missing_tool.test.cjs
-const { loadAgentOutput } = require("/tmp/gh-aw/actions/load_agent_output.cjs");
+const { loadAgentOutput } = require("./load_agent_output.cjs");
-summary: { addRaw: vi.fn().mockReturnThis(), write: vi.fn().mockResolvedValue() },
+summary: { addRaw: vi.fn().mockReturnThis(), addHeading: vi.fn().mockReturnThis(), write: vi.fn().mockResolvedValue() },

All 109 test files now pass (2238 tests).

Original prompt

Format, lint, fix js tests

Custom agent used: ci-cleaner
Tidies up the repository CI state by formatting sources, running linters, fixing issues, running tests, and recompiling workflows


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

… add missing mock method

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Format and lint JavaScript tests Fix hardcoded absolute paths and missing mock in JS tests Dec 23, 2025
Copilot AI requested a review from pelikhan December 23, 2025 19:39
@pelikhan pelikhan marked this pull request as ready for review December 23, 2025 19:59
@pelikhan pelikhan merged commit c823387 into main Dec 23, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/format-lint-fix-js-tests branch December 23, 2025 19:59
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.

2 participants