-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Refactoring: Consuming log-symbols alternate to code for win32 in reporters/base. #4389
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. this looks good to me, but I think we need to consider it a breaking change, so it should wait for v9.0.0.
Can you please sign the CLA?
Ok, I did it :) |
I've re-run AppVeyor and it passed. |
@MoonSupport could you rebase to |
@juergba Done :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MoonSupport thank you for this PR.
Currently looking into all the dependencies... and one of your dependencies are log-symbol log-symbols seems like a perfect package if it had just only precomputed the values instead of using chalk as an dependency import isUnicodeSupported from 'is-unicode-supported';
const main = {
info: '\x1B[34mℹ\x1B[39m',
success: '\x1B[32m✔\x1B[39m',
warning: '\x1B[33m⚠\x1B[39m',
error: '\x1B[31m✖\x1B[39m'
};
const fallback = {
info: '\x1B[34mi\x1B[39m',
success: '\x1B[32m√\x1B[39m',
warning: '\x1B[33m‼\x1B[39m',
error: '\x1B[31m×\x1B[39m'
};
const logSymbols = isUnicodeSupported() ? main : fallback;
export default logSymbols; Here is one tough: how about inlining this symbols into mocha itself? |
@jimmywarting thank you. The size of the code is not the only criteria. All those codes/numbers (unicode?) isn't the detail level I want to deal with. We need a package which works for different OS/browsers and is well maintained by someone else, not by Mocha. |
Description of the Change
I used the
log-symbols
instead of the code for win32.Alternate Designs
No alternate designs
Benefits
Mocha already uses
log-symbols
, so we can remove duplicated code and maintain consistency.Possible Drawbacks
I also deleted the
dot
case, But I don't know if the size difference between dot for win32(.
) and dot for the others(․
) is a problem.So I think this might be a problem.
Applicable issues
[WSL] Test report corruption #4353
The above issue is not directly related to the PR.
But I think you may want to use alphabets rather than
log-symbols
to resolve the issue.like this
Please leave a good comment or question at any time :)