Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

Implements VS Code extension host testing for command activation validation, per PR #5424 discussion.

Changes

  • Test Infrastructure

    • src/test/runTest.ts - @vscode/test-electron runner
    • src/test/suite/index.ts - Mocha suite configuration
    • src/test/suite/extension.test.ts - Extension activation and command registration tests
  • Test Coverage

    • Extension activation
    • Command registration for all 6 contributed commands
    • Non-interactive command execution (showLog, showSettings)
    • Package.json consistency validation
  • Dependencies

    • Added @vscode/test-electron, mocha, glob with type definitions
    • Added test and pretest npm scripts

Limitations

Interactive commands (start, stop, manageAllowlist, showMenu) are validated for registration only. Execution testing requires mocking UI interactions to avoid blocking on dialogs.

Example

test('Command playwright-local-browser-server.showLog should execute without error', async () => {
  await vscode.commands.executeCommand('playwright-local-browser-server.showLog');
  assert.ok(true, 'showLog command executed');
});

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: /usr/local/bin/node node ./lib/test/runTest.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Add Test Harness for VS Code Extensions</issue_title>
<issue_description>these command activations can also be tested through the vscode extension host test harness.
https://code.visualstudio.com/api/working-with-extensions/testing-extension

Originally posted by @bmiddha in #5424 (comment)
</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits January 31, 2026 22:43
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test harness for VS Code extensions Add VS Code extension test harness for Playwright Local Browser Server Jan 31, 2026
Copilot AI requested a review from TheLarkInn January 31, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

Add Test Harness for VS Code Extensions

2 participants