Multiple Small fixes on JS/TS codebases - #1720
Conversation
Saga4
commented
Mar 2, 2026
- feat: bundle JUnit XML reporter for Jest, replacing external jest-junit dependency
- feat: discover const arrow functions exported via named export clauses
- feat: discover object methods exported via CJS module.exports = variable
- fix: raise clear error for unsupported JS test frameworks instead of silent fallback
- feat: add skip_confirm and skip_api_key params to JS init for non-interactive mode
- fix: show actionable error when JS/TS function exists but is not exported
…it dependency Ship a zero-dependency jest-reporter.js inside the codeflash runtime package instead of requiring the external jest-junit npm package. This ensures the reporter is always available when codeflash is installed, fixing Jest-based projects (Strapi, Moleculer) that failed because jest-junit wasn't installed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Post-process find_functions() to mark functions as exported when they appear
in named export clauses like `export { joinBy }`. This fixes discovery for
TypeScript codebases (e.g., Strapi) that define const arrow functions and
export them via a separate export statement.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolve `module.exports = varName` where varName is an object literal
containing methods. For patterns like `const utils = { match() {} };
module.exports = utils;`, the individual methods are now recognized as
exported. This fixes function discovery for CJS libraries like Moleculer.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…silent fallback Add NotImplementedError guard in all 3 test dispatchers (behavioral, benchmarking, line-profile) for frameworks other than jest and vitest. Previously, mocha and other frameworks silently fell through to Jest, causing confusing failures. Now users get a clear error message. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…eractive mode Allow init_js_project(), should_modify_package_json_config(), and collect_js_setup_info() to run without interactive prompts when skip_confirm=True. Uses auto-detected defaults instead of prompting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rted When a user targets a function that exists in the file but is not exported, show a clear message suggesting they add an export statement, instead of the generic "function not found" error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR Review SummaryPrek ChecksAll checks pass. MypyAll mypy errors in changed source files are pre-existing (subprocess.run overload issues, CompletedProcess generic params, Code ReviewBug: Dead code with wrong arguments — No other runtime bugs, security vulnerabilities, or breaking API changes found. The PR is well-structured:
Test Coverage150 tests pass. Coverage for changed source files:
New file Last updated: 2026-03-02T12:00:00Z |
⚡️ Codeflash found optimizations for this PR📄 30% (0.30x) speedup for
|
⚡️ Codeflash found optimizations for this PR📄 46% (0.46x) speedup for
|