You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're looking at ways in which we can improve debugging in nspec especially for an individual example. One solution I've come up with is to extend the nspec base class with the following:
public nspec()
{
_it = new ActionRegister((name, tags, action) => it[name, "debug"] = action);
}
public ActionRegister _it;
Then in the VS Code launch configuration providing the debug tag when calling dotnet run.
This is a bit of a precursor for a workshop I'm having with my team in Berlin next week as they have started putting some time into the VS Test Adaptor. One challenge with the adaptor is how to run a single example, without having to change the code like I'm doing above. Had you ever explored this? It would require each example to have some kind of identity within the context tree so that it can be identified at runtime.
The text was updated successfully, but these errors were encountered:
Just pasting here my (amended) twitter reply, to the benefit of public discussion:
Regarding what is already available, I remember two ways:
in VS, with NSpec.VsAdapter, you can right-click on the test view to run a single context. If you pick a single it, all its siblings will be run anyway
in NSpec runner from command line, you can temporarily change the test code to add a "focus" attribute on context / it, to just run that
I don't know how/if things work in VS Code w.r.t. full VS.
Regarding new features, I'm ok to see a new one if that helps. Not sure what would you use, from the outside, as an identifier for a test case, apart from its "breadcrumb", so to say: context / subcontext / subcontext / it
Hey guys,
We're looking at ways in which we can improve debugging in nspec especially for an individual example. One solution I've come up with is to extend the nspec base class with the following:
Then in the VS Code launch configuration providing the
debug
tag when calling dotnet run.This is a bit of a precursor for a workshop I'm having with my team in Berlin next week as they have started putting some time into the VS Test Adaptor. One challenge with the adaptor is how to run a single example, without having to change the code like I'm doing above. Had you ever explored this? It would require each example to have some kind of identity within the context tree so that it can be identified at runtime.
The text was updated successfully, but these errors were encountered: