test(linter/plugins): conformance tester keep other module exports when mocking RuleTester modules#18679
Merged
graphite-app[bot] merged 1 commit intomainfrom Jan 28, 2026
Conversation
Member
Author
This was referenced Jan 28, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refines how the conformance runner mocks RuleTester so that when a module exposes RuleTester alongside other exports (e.g. eslint), only the RuleTester export is replaced, preserving the rest of the module’s API.
Changes:
- Redefines
TestGroup.ruleTestersfrom a list of module specifier strings to a list of{ specifier, propName }objects, allowing selective replacement of a single export or the entire module. - Updates the conformance runner’s
runGrouplogic to either replacemodule.exportswith the conformanceRuleTesteror to overwrite a specific property on the loaded module, depending onpropName. - Migrates the
eslintandreact-hookstest groups to the newruleTestersshape so thateslint-v7/v8/v9retain their non-RuleTesterexports while still using the conformanceRuleTester.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
apps/oxlint/conformance/src/index.ts |
Extends TestGroup.ruleTesters to carry specifier and propName, and updates the mocking logic to selectively replace either the whole module or just a named RuleTester export. |
apps/oxlint/conformance/src/groups/react_hooks.ts |
Adapts the React Hooks test group to the new ruleTesters format, targeting the RuleTester property of the eslint-v7/v8/v9 modules instead of replacing those modules entirely. |
apps/oxlint/conformance/src/groups/eslint.ts |
Adapts the ESLint core test group to the new ruleTesters shape while still replacing the dedicated rule-tester module’s exports with the conformance RuleTester. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9f89c2d to
8ae77ab
Compare
81d4d84 to
f626725
Compare
Contributor
Merge activity
|
…en mocking `RuleTester` modules (#18679) When mocking modules containing `RuleTester`, don't replace the whole module, just alter the `RuleTester` property within it. e.g. when mocking the `RuleTester` export of `eslint` package, leave all package's other exports unchanged.
8ae77ab to
f9949a0
Compare
f626725 to
70e4bd2
Compare
Base automatically changed from
om/01-28-test_linter_plugins_conformance_tester_catch_errors_in_describe_callbacks
to
main
January 28, 2026 23:09
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.

When mocking modules containing
RuleTester, don't replace the whole module, just alter theRuleTesterproperty within it. e.g. when mocking theRuleTesterexport ofeslintpackage, leave all package's other exports unchanged.