@@ -23,6 +23,7 @@ import configuration from "../configuration";
2323import { buildOptions , getBuildAllTask } from "../SwiftTaskProvider" ;
2424import { SwiftExecOperation , TaskOperation } from "../TaskQueue" ;
2525import * as TestDiscovery from "./TestDiscovery" ;
26+ import { TargetType } from "../SwiftPackage" ;
2627
2728/** Build test explorer UI */
2829export class TestExplorer {
@@ -67,7 +68,7 @@ export class TestExplorer {
6768 ) {
6869 this . testFileEdited = false ;
6970 // only run discover tests if the library has tests
70- if ( this . folderContext . swiftPackage . getTargets ( " test" ) . length > 0 ) {
71+ if ( this . folderContext . swiftPackage . getTargets ( TargetType . test ) . length > 0 ) {
7172 this . discoverTestsInWorkspace ( ) ;
7273 }
7374 }
@@ -97,7 +98,7 @@ export class TestExplorer {
9798 switch ( event ) {
9899 case FolderEvent . add :
99100 if ( folder ) {
100- if ( folder . swiftPackage . getTargets ( " test" ) . length > 0 ) {
101+ if ( folder . swiftPackage . getTargets ( TargetType . test ) . length > 0 ) {
101102 folder . addTestExplorer ( ) ;
102103 // discover tests in workspace but only if disableAutoResolve is not on.
103104 // discover tests will kick off a resolve if required
@@ -109,7 +110,8 @@ export class TestExplorer {
109110 break ;
110111 case FolderEvent . packageUpdated :
111112 if ( folder ) {
112- const hasTestTargets = folder . swiftPackage . getTargets ( "test" ) . length > 0 ;
113+ const hasTestTargets =
114+ folder . swiftPackage . getTargets ( TargetType . test ) . length > 0 ;
113115 if ( hasTestTargets && ! folder . hasTestExplorer ( ) ) {
114116 folder . addTestExplorer ( ) ;
115117 // discover tests in workspace but only if disableAutoResolve is not on.
0 commit comments