Conversation
Decouples pure logic from VS Code dependencies to allow fast unit testing without launching a VS Code instance. Changes: - Extracted `src/core/types.ts`, `src/core/constants.ts`, and `src/core/logic.ts` from `src/core/config.ts`. - Refactored `src/ai/registry.ts` and `src/ai/selector.ts` to use type-only imports for `vscode`. - Organized tests into `src/test/unit` and `src/test/integration`. - Added `npm run test:unit` script (Mocha) and `npm run test:integration` (`@vscode/test-cli`). - Updated `lint-staged` and GitHub CI to run unit tests separately.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This change implements best practices for VS Code extension testing by separating unit tests (fast, no VS Code dependency) from integration tests (slower, require VS Code).
Key changes:
Code Decoupling:
src/core/config.tsto isolate pure types, constants, and logic from the VS Code-dependent configuration retrieval.src/ai/registry.tsto useimport typeforvscode, allowing it to be loaded in a standard Node.js environment.Test Reorganization:
utils.test.ts,http_error.test.ts,ai.test.ts) tosrc/test/unit/.extension.test.ts,config.test.ts) tosrc/test/integration/.Configuration:
test:unitandtest:integrationscripts topackage.json.lint-stagedto run unit tests on pre-commit for TypeScript files..vscode-test.mjsto only target integration tests..github/workflows/ci.yml) to run unit tests and integration tests as separate steps.Verification:
npm run test:unitruns successfully in <1s without launching VS Code.PR created automatically by Jules for task 11259745142441659807 started by @gasatrya