-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test: TestRunRequest.preserveFocus API #213601
Comments
Hey @connor4312 I am testing this issue currently and I modified the repo so that on line 91, we have:
In this way the request uses Screen.Recording.2024-05-28.at.15.16.27.movI am doing this because I previously tried running
But running my custom command would hang for 5 minutes with no apparent progress. So I was trying to reuse the existing code. |
This property controls whether focus is transferred when the test run is triggered outside of the normal VS Code UI, e.g. by a custom command. I don't think copying The second case is actually fine, you just want to end the run yourself -- it's not automatically dispatched for you. Having an empty test run is sufficient for testing this behavior, so you can do: vscode.commands.registerCommand('hello-world', () => {
const req = new vscode.TestRunRequest(
undefined,
undefined,
runProfile,
false,
/* preserveFocus= */ true
);
ctrl.createTestRun(req).end();
}); |
Refs: #209491
Complexity: 3
Create Issue
We've added a
preserveFocus
API on theTestRunRequest
, which can be used to create test runs.ctrl.createTestRun
to run tests. (Or manually invoke theprofile.runHandler
)ctrl.createTestRun
, validate the behavior of the newpreserveFocus
boolean behaves as expected. Read through the docstring and make sure it makes sense.The text was updated successfully, but these errors were encountered: