Giter Club home page Giter Club logo

Comments (2)

aiday-mar avatar aiday-mar commented on August 16, 2024

Hey @connor4312 I am testing this issue currently and I modified the repo so that on line 91, we have:

const newReq: vscode.TestRunRequest = { ...req, preserveFocus: false };
const task = ctrl.createTestRun(newReq);

In this way the request uses preserveFocus: false when running the tests for the testing profiles that already exist. Am I correct in understanding that by executing the action Run with Electron, the focus should now move to the test results view? I am finding it hard to determine if the focus is on the test results view as there does not appear to be a distinct change of focus when you click on the test results view in the terminal.

Screen.Recording.2024-05-28.at.15.16.27.mov

I am doing this because I previously tried running ctrl.createTestRun from a command with my custom vscode.TestRunRequest as follows:

const req: vscode.TestRunRequest = { include: undefined, exclude: undefined, profile: undefined, preserveFocus: false};
const task = ctrl.createTestRun(req);

But running my custom command would hang for 5 minutes with no apparent progress. So I was trying to reuse the existing code.

from vscode.

connor4312 avatar connor4312 commented on August 16, 2024

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 newReq alone will show the correct behavior, because there is also a request out from VS Code itself and focus handling is already done.

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();
});

from vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.