Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

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:

  1. Code Decoupling:

    • Split src/core/config.ts to isolate pure types, constants, and logic from the VS Code-dependent configuration retrieval.
    • Updated all consumers to import from the new modular files.
    • Refactored src/ai/registry.ts to use import type for vscode, allowing it to be loaded in a standard Node.js environment.
  2. Test Reorganization:

    • Moved pure logic tests (utils.test.ts, http_error.test.ts, ai.test.ts) to src/test/unit/.
    • Moved integration tests (extension.test.ts, config.test.ts) to src/test/integration/.
    • Updated imports in test files.
  3. Configuration:

    • Added test:unit and test:integration scripts to package.json.
    • Configured lint-staged to run unit tests on pre-commit for TypeScript files.
    • Updated .vscode-test.mjs to only target integration tests.
    • Updated GitHub CI (.github/workflows/ci.yml) to run unit tests and integration tests as separate steps.

Verification:

  • npm run test:unit runs successfully in <1s without launching VS Code.
  • CI workflow is updated to support the new structure.

PR created automatically by Jules for task 11259745142441659807 started by @gasatrya

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.
@google-labs-jules
Copy link
Contributor Author

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gasatrya gasatrya marked this pull request as ready for review January 15, 2026 10:22
@gasatrya gasatrya merged commit 77a53c9 into main Jan 15, 2026
0 of 3 checks passed
@gasatrya gasatrya deleted the refactor-tests-split-unit-integration-11259745142441659807 branch January 15, 2026 14:54
@github-actions
Copy link

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants