( globalConfig: Config.GlobalConfig, watchPlugins: Array<WatchPlugin>, delimiter = '\n', )
| 534 | }; |
| 535 | |
| 536 | const usage = ( |
| 537 | globalConfig: Config.GlobalConfig, |
| 538 | watchPlugins: Array<WatchPlugin>, |
| 539 | delimiter = '\n', |
| 540 | ) => { |
| 541 | const testPathPatterns = globalConfig.testPathPatterns; |
| 542 | const messages = [ |
| 543 | activeFilters(globalConfig), |
| 544 | |
| 545 | testPathPatterns.isSet() || globalConfig.testNamePattern |
| 546 | ? `${chalk.dim(' \u203A Press ')}c${chalk.dim(' to clear filters.')}` |
| 547 | : null, |
| 548 | `\n${chalk.bold('Watch Usage')}`, |
| 549 | |
| 550 | globalConfig.watch |
| 551 | ? `${chalk.dim(' \u203A Press ')}a${chalk.dim(' to run all tests.')}` |
| 552 | : null, |
| 553 | |
| 554 | globalConfig.onlyFailures |
| 555 | ? `${chalk.dim(' \u203A Press ')}f${chalk.dim( |
| 556 | ' to quit "only failed tests" mode.', |
| 557 | )}` |
| 558 | : `${chalk.dim(' \u203A Press ')}f${chalk.dim( |
| 559 | ' to run only failed tests.', |
| 560 | )}`, |
| 561 | |
| 562 | (globalConfig.watchAll || |
| 563 | testPathPatterns.isSet() || |
| 564 | globalConfig.testNamePattern) && |
| 565 | !globalConfig.noSCM |
| 566 | ? `${chalk.dim(' \u203A Press ')}o${chalk.dim( |
| 567 | ' to only run tests related to changed files.', |
| 568 | )}` |
| 569 | : null, |
| 570 | |
| 571 | ...getSortedUsageRows(watchPlugins, globalConfig).map( |
| 572 | plugin => |
| 573 | `${chalk.dim(' \u203A Press')} ${plugin.key} ${chalk.dim( |
| 574 | `to ${plugin.prompt}.`, |
| 575 | )}`, |
| 576 | ), |
| 577 | |
| 578 | `${chalk.dim(' \u203A Press ')}Enter${chalk.dim( |
| 579 | ' to trigger a test run.', |
| 580 | )}`, |
| 581 | ]; |
| 582 | |
| 583 | return `${messages.filter(message => !!message).join(delimiter)}\n`; |
| 584 | }; |
| 585 | |
| 586 | const showToggleUsagePrompt = () => |
| 587 | '\n' + |
no test coverage detected