Fix test suite failures caused by ESM-only @octokit/core and probot dependencies#938
Merged
decyjphr merged 3 commits intodependabot/npm_and_yarn/probot-14.2.4from Mar 2, 2026
Conversation
Co-authored-by: decyjphr <57544838+decyjphr@users.noreply.github.com>
Co-authored-by: decyjphr <57544838+decyjphr@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions workflow test
Fix test suite failures caused by ESM-only Mar 2, 2026
@octokit/core and probot dependencies
4905b0a
into
dependabot/npm_and_yarn/probot-14.2.4
2 checks passed
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes two failing unit test suites caused by @octokit/core and probot being ESM-only packages ("type": "module") that cannot be consumed via require() in Jest's CommonJS environment.
Changes:
- Replaced the
require('@octokit/core')import insettings.test.jswith a local empty stub class, which works identically given thatjest.mocked()in plain JavaScript simply returns the class constructor. - Added a
jest.mock('probot', ...)call inindex.test.jsto short-circuit the ESM module load, since all tests in that file are alreadydescribe.skip'd and the failure was purely at module-load time.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
test/unit/lib/settings.test.js |
Replaces ESM require('@octokit/core') with a local empty class Octokit {} stub |
test/unit/index.test.js |
Adds jest.mock('probot', ...) to prevent ESM-load failure at module resolution time |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
decyjphr
added a commit
that referenced
this pull request
Mar 3, 2026
* build(deps): bump probot from 13.4.4 to 14.2.4 Bumps [probot](https://github.com/probot/probot) from 13.4.4 to 14.2.4. - [Release notes](https://github.com/probot/probot/releases) - [Commits](probot/probot@v13.4.4...v14.2.4) --- updated-dependencies: - dependency-name: probot dependency-version: 14.2.4 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Fix test suite failures caused by ESM-only `@octokit/core` and `probot` dependencies (#938) * Initial plan * Initial plan for fixing failing test suites Co-authored-by: decyjphr <57544838+decyjphr@users.noreply.github.com> * Fix failing test suites caused by ESM-only dependencies Co-authored-by: decyjphr <57544838+decyjphr@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: decyjphr <57544838+decyjphr@users.noreply.github.com> * Update minimatch dependency version to 10.2.1 * Fix devcontainer configuration and update dependencies (#942) * fix devcontainer * Update .devcontainer/Dockerfile Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .devcontainer/Dockerfile Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .devcontainer/devcontainer.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yadhav Jayaraman <57544838+decyjphr@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two unit test suites were failing to load because
@octokit/coreandprobotare now ESM-only packages ("type": "module") and cannot be consumed viarequire().Changes
test/unit/lib/settings.test.js: Removedrequire('@octokit/core').Octokitwas only used as a mock property container viajest.mocked()— replaced with a local empty class:test/unit/index.test.js: Addedjest.mock('probot', ...)to short-circuit the ESM load. All tests in this file are alreadydescribe.skip'd; the suite was failing purely at the module loading stage.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.