Skip to content

Unified 'no tests found' message for non-verbose MPR#4354

Merged
cpojer merged 1 commit intojestjs:masterfrom
chitchu:issue/165
Aug 25, 2017
Merged

Unified 'no tests found' message for non-verbose MPR#4354
cpojer merged 1 commit intojestjs:masterfrom
chitchu:issue/165

Conversation

@chitchu
Copy link
Contributor

@chitchu chitchu commented Aug 25, 2017

Summary

Unified 'No test found' message for non-verbose MPR

Will now look like:

No tests found
In /Projects/jest
  X files checked across Y projects. for more details run with `--verbose`
Pattern: xyz321 - 0 matches

Resolves #4324

Test plan

Copy link
Contributor

@boujeepossum boujeepossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great!
thanks for adding the test too!
just refactor the message generation function and i think it's good to go!

const statsMessage = Object.keys(stats)
.map(key => {
if (key === 'roots' && config.roots.length === 1) {
if (globalConfig.verbose) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this whole function is getting pretty massive!
do you mind extracting it into a separate module get_no_test_found_message.js and splitting up a little?

something like:

// ...
const getNoTestsFoundMessage = (testRunData, globalConfig) => {
  if (globalConfig.onlyChanged) {
    return getNoTestFoundRelatedToChangedFiles(globalConfig);
  }

  return globalConfig.verbose
    ? getNoTestFoundVerbose(globalConfig, testRunData)
    : getNoTestFound(globalConfig, testRunData);
}

module.exports = getNoTestsFoundMessage;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing! Commit amended.

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify no tests found message when running MPR

4 participants