Skip to content

[WIP] Fix failing tests in the project#13203

Merged
pelikhan merged 2 commits intocopilot/add-js-frontmatter-hash-testfrom
copilot/fix-tests-yet-again
Feb 2, 2026
Merged

[WIP] Fix failing tests in the project#13203
pelikhan merged 2 commits intocopilot/add-js-frontmatter-hash-testfrom
copilot/fix-tests-yet-again

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

Fix Test Validation for GitHub API Test Files

The test TestCJSFilesNoActionsRequires was failing because two test files use require("@actions/github"):

  • frontmatter_hash_github_api.test.cjs - Vitest test file
  • test-live-github-api.cjs - Standalone test script

These files are for testing GitHub API integration and are not deployed to GitHub Actions runners.

Changes

  • Understand the issue - test files using @actions/github are caught by validation
  • Update test validation to exclude test files (.test.cjs and test-*.cjs files)
  • Verify fix by running the failing test - ✅ Test passes (184 production .cjs files checked)
  • Run full test suite to ensure no regressions - ✅ All tests pass
  • Format code with make fmt - ✅ Done
  • Commit changes and push to branch - ✅ Done

Solution

Updated TestCJSFilesNoActionsRequires to exclude:

  • Files ending with .test.cjs (vitest test files)
  • Files starting with test- (standalone test scripts)

These test files are not part of the runtime deployment and can safely use @actions/* packages for testing purposes.

Test Results

Before fix:

Found 2 file(s) with invalid require statements:
  - frontmatter_hash_github_api.test.cjs
  - test-live-github-api.cjs

After fix:

✓ All 184 .cjs files use valid require statements
Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/21576910853/job/62167864273#step:8:1

Fix tests


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Test files (*.test.cjs, test-*.cjs) are not deployed to GitHub Actions
runners and may use @actions/* packages for testing purposes. Updated
TestCJSFilesNoActionsRequires to exclude these files from validation.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review February 2, 2026 05:16
@pelikhan pelikhan merged commit 2e65267 into copilot/add-js-frontmatter-hash-test Feb 2, 2026
2 checks passed
@pelikhan pelikhan deleted the copilot/fix-tests-yet-again branch February 2, 2026 05:17
Copilot AI requested a review from pelikhan February 2, 2026 05:17
Copilot stopped work on behalf of pelikhan due to an error February 2, 2026 05:17
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