Skip to content

fix: align qmd_index test assertion with ERR_CONFIG error message prefix#22671

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-tests-or-compiled-code
Mar 24, 2026
Merged

fix: align qmd_index test assertion with ERR_CONFIG error message prefix#22671
pelikhan merged 2 commits intomainfrom
copilot/fix-tests-or-compiled-code

Conversation

Copy link
Contributor

Copilot AI commented Mar 24, 2026

Test was asserting the bare error message while production code prefixes all config errors with ERR_CONFIG: via error_codes.cjs.

Change

  • qmd_index.test.cjs: updated exact-match assertion to include the ERR_CONFIG: prefix
- expect(mockCore.setFailed).toHaveBeenCalledWith("QMD_CONFIG_JSON environment variable not set");
+ expect(mockCore.setFailed).toHaveBeenCalledWith("ERR_CONFIG: QMD_CONFIG_JSON environment variable not set");

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

@github-actions github-actions bot mentioned this pull request Mar 24, 2026
Copilot AI changed the title [WIP] Fix tests or compiled code fix: align qmd_index test assertion with ERR_CONFIG error message prefix Mar 24, 2026
Copilot AI requested a review from pelikhan March 24, 2026 12:18
@pelikhan pelikhan marked this pull request as ready for review March 24, 2026 12:25
Copilot AI review requested due to automatic review settings March 24, 2026 12:25
@pelikhan pelikhan merged commit a9bb7eb into main Mar 24, 2026
50 checks passed
@pelikhan pelikhan deleted the copilot/fix-tests-or-compiled-code branch March 24, 2026 12:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns the qmd_index unit test with the production error formatting, which prefixes configuration errors with ERR_CONFIG:.

Changes:

  • Updated the missing-config assertion in qmd_index.test.cjs to include the ERR_CONFIG: prefix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

it("fails when QMD_CONFIG_JSON is not set", async () => {
await runMain(undefined);
expect(mockCore.setFailed).toHaveBeenCalledWith("QMD_CONFIG_JSON environment variable not set");
expect(mockCore.setFailed).toHaveBeenCalledWith("ERR_CONFIG: QMD_CONFIG_JSON environment variable not set");
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion hard-codes the error code prefix string. To keep tests aligned with the central source of truth (and consistent with other tests in this repo), import ERR_CONFIG from ./error_codes.cjs and build the expected message using that constant (e.g., ${ERR_CONFIG}: ...).

Copilot uses AI. Check for mistakes.
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.

3 participants