$ show firsttris/vscode-jest-runner
This repository is a VS Code extension that provides test running and debugging capabilities for multiple testing frameworks (Jest, Vitet, Node.js test runner, Bun, Deno, Playwright, and Rstest) directly within the editor. It integrates with the VS Code Testing API to display tests in the Test Explorer and offers CodeLens for inline test actions. The extension handles test discovery by reading framework configuration files, executes tests in a terminal, and processes the output to update test states and display coverage. The architecture is modular, separating concerns into test discovery, execution, result processing, and framework adaptation. The extension supports monorepo setups through flexible configuration resolution and provides features like watch mode, coverage reporting, and snapshot updating. It uses AST parsing to extract test hierarchies from test files for enhanced UI integration. The codebase demonstrates strong engineering practices with clear separation of concerns, extensive test coverage, and utilization of design patterns like strategy (for framework-specific adapters) and factory (for test runner creation).
The LLM identified 3 files worth highlighting for reuse:
Provides utility functions for building and manipulating command-line arguments, including escaping and joining. This self-contained module has no external dependencies beyond the standard library and can be reused in any Node.js application that constructs CLI commands.
A simple, configurable logger that prefixes messages and can be enabled or disabled. It is self-contained with no dependencies and can be easily extracted for use in any TypeScript or JavaScript project needing lightweight logging.
Implements module resolution logic similar to Node's require.resolve, with support for checking multiple paths and file extensions. This utility is self-contained, relying only on Node.js built-in modules (fs, path, module), and can be reused in any project that needs to resolve module paths programmatically.