feat: add JavaScript test_coverage hooks for test mapping#515
Open
elfensky wants to merge 2 commits intopeteromallet:mainfrom
Open
feat: add JavaScript test_coverage hooks for test mapping#515elfensky wants to merge 2 commits intopeteromallet:mainfrom
elfensky wants to merge 2 commits intopeteromallet:mainfrom
Conversation
The JavaScript language plugin was missing a test_coverage module, causing the test coverage detector to silently return empty results for pure JS projects (e.g. Next.js without TypeScript). This adds the missing hooks and fixes .mjs/.cjs extension mapping. Closes peteromallet#514 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
31 tests covering map_test_to_source (including __tests__/unit/ traversal), has_testable_logic, strip_test_markers, parse_test_import_specs, and contract exports. Also adds /index.jsx and /index.cjs to _JS_EXTENSIONS. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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.
Summary
Closes #514
The JavaScript language plugin was missing a
test_coverage.pymodule, causing the test coverage detector to silently return empty results for pure JS projects (e.g., Next.js without TypeScript).desloppify/languages/javascript/test_coverage.py— adapted from the TypeScript version with JS-appropriate extensions (.js,.jsx,.mjs,.cjs) and nested__tests__/unit/directory handlingdesloppify/languages/javascript/__init__.py— registered thetest_coverage_moduleviageneric_lang()desloppify/engine/detectors/coverage/mapping_imports.py— added.mjsand.cjsto_infer_lang_name()extension mapTest results
test_lang_standardization.py) passes — JS plugin meets the contract.mjsfiles,jsconfig.json):🤖 Generated with Claude Code