@@ -33,6 +33,10 @@ import TestNamePatternPlugin from './plugins/test_name_pattern';
3333import UpdateSnapshotsPlugin from './plugins/update_snapshots' ;
3434import UpdateSnapshotsInteractivePlugin from './plugins/update_snapshots_interactive' ;
3535import QuitPlugin from './plugins/quit' ;
36+ import {
37+ getSortedUsageRows ,
38+ filterInteractivePlugins ,
39+ } from './lib/watch_plugins_helpers' ;
3640import activeFilters from './lib/active_filters_message' ;
3741
3842let hasExitListener = false ;
@@ -45,24 +49,6 @@ const INTERNAL_PLUGINS = [
4549 QuitPlugin ,
4650] ;
4751
48- const getSortedUsageRows = (
49- watchPlugins : Array < WatchPlugin > ,
50- globalConfig : GlobalConfig ,
51- ) => {
52- const internalPlugins = watchPlugins
53- . slice ( 0 , INTERNAL_PLUGINS . length )
54- . map ( p => p . getUsageInfo && p . getUsageInfo ( globalConfig ) )
55- . filter ( Boolean ) ;
56-
57- const thirdPartyPlugins = watchPlugins
58- . slice ( INTERNAL_PLUGINS . length )
59- . map ( p => p . getUsageInfo && p . getUsageInfo ( globalConfig ) )
60- . filter ( Boolean )
61- . sort ( ( a , b ) => a . key - b . key ) ;
62-
63- return internalPlugins . concat ( thirdPartyPlugins ) ;
64- } ;
65-
6652export default function watch (
6753 initialGlobalConfig : GlobalConfig ,
6854 contexts : Array < Context > ,
@@ -285,7 +271,10 @@ export default function watch(
285271 return ;
286272 }
287273
288- const matchingWatchPlugin = watchPlugins . find ( plugin => {
274+ const matchingWatchPlugin = filterInteractivePlugins (
275+ watchPlugins ,
276+ globalConfig ,
277+ ) . find ( plugin => {
289278 const usageData =
290279 ( plugin . getUsageInfo && plugin . getUsageInfo ( globalConfig ) ) || { } ;
291280 return usageData . key === parseInt ( key , 16 ) ;
0 commit comments