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

Fix unhandled error when a bad revision is provided to changedSince #7115

Merged
merged 6 commits into from
Oct 7, 2018
Merged

Fix unhandled error when a bad revision is provided to changedSince #7115

merged 6 commits into from
Oct 7, 2018

Conversation

khuyn003
Copy link
Contributor

@khuyn003 khuyn003 commented Oct 7, 2018

Summary

This PR fixes #7025 – when a bad revision is passed to the --changedSince argument, causing an unhandled rejection error message. It will now output the error message from git/hg instead.

Before:
screen shot 2018-10-07 at 1 23 37 pm

After:
screen shot 2018-10-07 at 1 22 30 pm

Test plan

Updated integration tests.

@SimenB
Copy link
Member

SimenB commented Oct 7, 2018

Thanks! This is cleaner than the original approach, but I pushed an alternate version moving the logic to jest-cli, which I think is even cleaner. WDYT?

@khuyn003
Copy link
Contributor Author

khuyn003 commented Oct 7, 2018

@SimenB looks great and even cleaner than what I did. 👍

@SimenB SimenB merged commit 477f461 into jestjs:master Oct 7, 2018
}).catch(e => {
const message = formatExecError(e, configs[0], {noStackTrace: true})
.split('\n')
.filter(line => !line || !line.includes('Command failed:'))
Copy link
Contributor Author

@khuyn003 khuyn003 Oct 7, 2018

Choose a reason for hiding this comment

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

@SimenB Just noticed the first part actually includes empty lines. Fixed in PR #7117

Copy link
Member

Choose a reason for hiding this comment

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

That's on purpose - we want to keep the newlines in the output. This is how it looks:
image

The condition is there in case typeof line !== 'string', but thinking about it, that can't happen

@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 12, 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.

jest --changedSince=blablabla crashes
3 participants