1- import { QuickPickItem , window } from 'vscode' ;
1+ import { QuickPickItem , window } from 'vscode' ;
22import * as vscode from 'vscode' ;
3- import { Tests , TestsToRun , TestFolder , TestFile , TestFunction , TestSuite , FlattenedTestFunction , TestStatus } from '../common/contracts' ;
4- import { getDiscoveredTests } from '../common/testUtils' ;
3+ import { Tests , TestFunction , FlattenedTestFunction , TestStatus } from '../common/contracts' ;
4+ import { getDiscoveredTests } from '../common/testUtils' ;
55import * as constants from '../../common/constants' ;
66import * as path from 'path' ;
77
@@ -13,7 +13,7 @@ export class TestDisplay {
1313 if ( item === message ) {
1414 vscode . commands . executeCommand ( constants . Commands . Tests_Stop ) ;
1515 }
16- } )
16+ } ) ;
1717 }
1818 public displayTestUI ( rootDirectory : string ) {
1919 const tests = getDiscoveredTests ( ) ;
@@ -93,6 +93,9 @@ function getSummary(tests?: Tests) {
9393function buildItems ( rootDirectory : string , tests ?: Tests ) : TestItem [ ] {
9494 const items : TestItem [ ] = [ ] ;
9595 items . push ( { description : '' , label : 'Run All Unit Tests' , type : Type . RunAll } ) ;
96+ if ( ! tests || tests . testFiles . length === 0 ) {
97+ items . push ( { description : '' , label : 'Discover Unit Tests' , type : Type . ReDiscover } ) ;
98+ }
9699 items . push ( { description : '' , label : 'Run Unit Test Method ...' , type : Type . SelectAndRunMethod } ) ;
97100
98101 let summary = getSummary ( tests ) ;
@@ -114,7 +117,6 @@ statusSortPrefix[TestStatus.Pass] = '4';
114117function buildItemsForFunctions ( rootDirectory : string , tests : FlattenedTestFunction [ ] , sortBasedOnResults : boolean = false , displayStatusIcons : boolean = false ) : TestItem [ ] {
115118 let functionItems : TestItem [ ] = [ ] ;
116119 tests . forEach ( fn => {
117- const classPrefix = fn . parentTestSuite ? fn . parentTestSuite . name + '.' : '' ;
118120 let icon = '' ;
119121 if ( displayStatusIcons && statusIconMapping . has ( fn . testFunction . status ) ) {
120122 icon = `${ statusIconMapping . get ( fn . testFunction . status ) } ` ;
0 commit comments