@@ -171,6 +171,7 @@ export default class TestsDataProvider implements TreeDataProvider<Element> {
171171 throw new Error ( "This function requires a workspace path." ) ;
172172 }
173173
174+ const ranAll = ! tests ;
174175 const paths = tests ?? this . files . map ( ( file ) => file . path ) ;
175176 const args = [ "test" , "-A" ] ;
176177
@@ -246,7 +247,6 @@ export default class TestsDataProvider implements TreeDataProvider<Element> {
246247
247248 const onExit = new Promise < TestFile [ ] > ( ( resolve , reject ) => {
248249 denoProcess . onDidExit ( ( ) => {
249- // TODO: explore the dangers regarding tests that take long to execute
250250 if ( loggingError ) {
251251 reject ( loggingError ) ;
252252 } else {
@@ -261,25 +261,28 @@ export default class TestsDataProvider implements TreeDataProvider<Element> {
261261 }
262262 }
263263
264- const paths = output . map ( ( file ) => file . path ) ;
265- const missingFiles = this . files . filter (
266- ( file ) => ! paths . includes ( file . path ) ,
267- ) ;
268- for (
269- const file of missingFiles
270- ) {
271- file . children = [ new Header ( "Failed to run" ) ] ;
272- }
264+ if ( ranAll ) {
265+ const paths = output . map ( ( file ) => file . path ) ;
266+ const missingFiles = this . files . filter (
267+ ( file ) => ! paths . includes ( file . path ) ,
268+ ) ;
269+ for (
270+ const file of missingFiles
271+ ) {
272+ file . children = [ new Header ( "Failed to run" ) ] ;
273+ }
273274
274- if ( missingFiles . length ) {
275- const configurationErrorNotificationRequest =
276- new NotificationRequest (
277- "co.gwil.deno.notifications.unexpectedEmptiness" ,
278- ) ;
279- configurationErrorNotificationRequest . title = "Check the console." ;
280- configurationErrorNotificationRequest . body =
281- "Deno may be failing to run some tests. Check the extension console for logging." ;
282- nova . notifications . add ( configurationErrorNotificationRequest ) ;
275+ if ( missingFiles . length ) {
276+ const configurationErrorNotificationRequest =
277+ new NotificationRequest (
278+ "co.gwil.deno.notifications.unexpectedEmptiness" ,
279+ ) ;
280+ configurationErrorNotificationRequest . title =
281+ "Check the console." ;
282+ configurationErrorNotificationRequest . body =
283+ "Deno may be failing to run some tests. Check the extension console for logging." ;
284+ nova . notifications . add ( configurationErrorNotificationRequest ) ;
285+ }
283286 }
284287
285288 resolve ( output ) ;
0 commit comments