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 issue with overly trimmed basenames when formatting test paths #33

Merged
merged 1 commit into from
Nov 10, 2019

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Nov 9, 2019

No description provided.

)}`,
),
);
return slash(chalk.bold(`${TRIMMING_DOTS}${basename.slice(-maxLength + 3)}`));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

While working on my previous PR I've noticed this issue. It basically was caused by the fact that maxLength was bigger than basename.length so a negative starting index has been calculated. We don't need to provide both start + end indexes as we always want to slice "till the end" - calculating just a starting index as a negative one simplifies things.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

nice, thanks!

@SimenB SimenB merged commit d1e8cfc into jest-community:master Nov 10, 2019
@SimenB
Copy link
Member

SimenB commented Nov 10, 2019

Published as 0.4.2

@Andarist Andarist deleted the fix-overly-trimmed-basename branch November 10, 2019 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants