Skip to content

Clipboard doesn't update for local windows tests #2913

Open

Description

@AndreasArvidsson

Work in production, debugging and in ci tests, but on my local windows machine when I'm running the tests all tests that update the clipboard fail. eg recorded test cases recorded/actions/copySecondToken

It's this line that fails:

await vscode.commands.executeCommand("editor.action.clipboardCopyAction");

I double checked and the selection is correct before running this command and still afterwards the clipboard is unchanged. I tested adding sleeps both before and after, but no go.

Activity

  1. changed the title [-]Clipboard doesn't update for locals windows tests[/-] [+]Clipboard doesn't update for local windows tests[/+] on May 6, 2025
  2. AndreasArvidsson commented on Jun 21, 2025

    @AndreasArvidsson
    MemberAuthor

    Work around for now is to not declare clipboard copy capabilities in newer vscode versions specifically when running tests.

    // FIXME: In newer versions of vscode the `editor.action.clipboardCopyAction`
    // command appears to be disabled / sandboxed in test mode.
    const supportsCopy =
    nodeGetRunMode() !== "test" || semver.lt(vscode.version, "1.98.0");

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions