Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 25, 2017

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

@aaronabramov aaronabramov 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