-
Notifications
You must be signed in to change notification settings - Fork 679
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
Add class name to the run/debug all tests #2416
Conversation
What did the output look like before? |
@TheRealPiotrP Just added the thing highlighted in yellow. Small change |
src/features/codeLensProvider.ts
Outdated
@@ -53,23 +54,25 @@ class RunTestsCodeLens extends TestCodeLens { | |||
constructor( | |||
range: protocol.V2.Range, | |||
fileName: string, | |||
name: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the other names here are qualified, fileName
, testMethodNames
, etc.
what does name
mean??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the name of that particular entity, when it is a method it will be the method name, when it is the class, it will be the class name. Any suggestions ? Does DisplayName
sound better ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, let's use a more informative name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rchande Got any suggestions for the name here?
Codecov Report
@@ Coverage Diff @@
## master #2416 +/- ##
==========================================
+ Coverage 63.05% 63.28% +0.22%
==========================================
Files 88 88
Lines 3987 3998 +11
Branches 564 564
==========================================
+ Hits 2514 2530 +16
+ Misses 1311 1306 -5
Partials 162 162
Continue to review full report at Codecov.
|
@@ -188,8 +191,8 @@ function createCodeLensesForElement(element: Structure.CodeElement, fileName: st | |||
let range = element.Ranges[SymbolRangeNames.Name]; | |||
|
|||
if (range && testFramework && testMethodName) { | |||
results.push(new RunTestsCodeLens(range, fileName, /*isTestContainer*/ false, testFramework, [testMethodName])); | |||
results.push(new DebugTestsCodeLens(range, fileName, /*isTestContainer*/ false, testFramework, [testMethodName])); | |||
results.push(new RunTestsCodeLens(range, fileName, element.DisplayName,/*isTestContainer*/ false, testFramework, [testMethodName])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does TS have the equivalent of C# named arguments? It would be neat to use those instead of the comment...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is object destructuring , but should we do that here microsoft/TypeScript#467 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's interesting approach...
src/features/codeLensProvider.ts
Outdated
@@ -53,23 +54,25 @@ class RunTestsCodeLens extends TestCodeLens { | |||
constructor( | |||
range: protocol.V2.Range, | |||
fileName: string, | |||
name: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, let's use a more informative name
@@ -188,8 +191,8 @@ function createCodeLensesForElement(element: Structure.CodeElement, fileName: st | |||
let range = element.Ranges[SymbolRangeNames.Name]; | |||
|
|||
if (range && testFramework && testMethodName) { | |||
results.push(new RunTestsCodeLens(range, fileName, /*isTestContainer*/ false, testFramework, [testMethodName])); | |||
results.push(new DebugTestsCodeLens(range, fileName, /*isTestContainer*/ false, testFramework, [testMethodName])); | |||
results.push(new RunTestsCodeLens(range, fileName, element.DisplayName,/*isTestContainer*/ false, testFramework, [testMethodName])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's interesting approach...
The output will now look like this