Skip to content

Commit f144303

Browse files
committed
test(js): add JavaScript tracer unit and E2E tests
Add comprehensive test coverage for JavaScript tracing: - Unit tests for trace parsing (function_calls and legacy schemas) - Unit tests for replay test generation (Jest and Vitest) - E2E test for full tracing pipeline with npm dependencies - Framework detection tests (Jest, Vitest, package.json)
1 parent 1efbcc8 commit f144303

File tree

3 files changed

+571
-15
lines changed

3 files changed

+571
-15
lines changed

.github/workflows/js-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@ jobs:
4747
uv run pytest tests/test_languages/test_vitest_e2e.py -v
4848
uv run pytest tests/test_languages/test_javascript_e2e.py -v
4949
uv run pytest tests/test_languages/test_javascript_support.py -v
50+
uv run pytest tests/test_languages/test_javascript_tracer.py -v
5051
uv run pytest tests/code_utils/test_config_js.py -v

packages/codeflash/runtime/trace-runner.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -378,18 +378,4 @@ function main() {
378378
}
379379
}
380380

381-
// Run if executed directly
382-
if (require.main === module) {
383-
main();
384-
}
385-
386-
// Export for programmatic use
387-
module.exports = {
388-
parseArgs,
389-
registerBabel,
390-
runScript,
391-
runJest,
392-
runVitest,
393-
runModule,
394-
main,
395-
};
381+
main();

0 commit comments

Comments
 (0)