When JavaScript/TypeScript support generates test files in __tests__
subdirectories adjacent to source files (e.g., src/foo/__tests__/codeflash-generated/),
these test files are not within the configured tests_project_rootdir.
Previously, verifier.py:37 called module_name_from_file_path() without
handling the ValueError that occurs when the test path is outside tests_root,
causing optimization runs to crash.
This fix adds try-except handling with a fallback to using just the filename,
matching the pattern already used in javascript/parse.py:330-333.
Fixes trace ID: 84f5467f-8acf-427f-b468-02cb3342097e
Changes:
- codeflash/verification/verifier.py:37-48: Added try-except for path computation
- tests/verification/test_verifier_path_handling.py: Added unit tests
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Error messages in coverage_utils.py hardcoded "Jest" even when the
test framework was Vitest. This caused confusion in logs when Vitest
tests failed (e.g., "Jest coverage file not found" when using Vitest).
The JestCoverageUtils class is used for both Jest and Vitest since
they share the same Istanbul/v8 coverage format. Error messages
should be framework-agnostic.
Changes:
- "Jest coverage file not found" → "JavaScript coverage file not found"
- "Failed to parse Jest coverage file" → "Failed to parse JavaScript coverage file"
- "No coverage data found for X in Jest coverage" → "No coverage data found for X in JavaScript coverage"
- "Function X not found in Jest fnMap" → "Function X not found in JavaScript fnMap"
Affected trace IDs: 37e5a406, 735555fa, 940dfe80, c1e1de0e, dbec6c33, de96b1ab, fcf08c6b (7 logs from Apr 4 00:50 batch)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>