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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: control stringification of error message #4128

Merged
merged 4 commits into from May 28, 2021

Conversation

syeutyu
Copy link
Contributor

@syeutyu syeutyu commented Dec 14, 2019

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions.

Description of the Change

Before, The order of the previous processing is as follows

  1. error message is function
  2. error include inspect parameter
  3. empty

After

  1. check include inspect custom function
  2. error message is function
  3. empty

So developers can custom error message if they want

I have been found util.inspect.custom API, but if set up util.inspect.custom that changed error format

釀夅叧釀忈叧釀呩叺釂剦釁a喓 2019-12-14 釀嬦叐釀掅叜 5 52 23

So this pr only change ordering with err.inspect function and err.message 馃槶

Benefits

Developer can custom error message handling in mocha

Applicable issues

issues:3985

@jsf-clabot
Copy link

jsf-clabot commented Dec 14, 2019

CLA assistant check
All committers have signed the CLA.

@outsideris outsideris added type: bug a defect, confirmed by a maintainer area: usability concerning user experience or interface labels Dec 14, 2019
@coveralls
Copy link

coveralls commented Dec 14, 2019

Coverage Status

Coverage remained the same at 94.273% when pulling 3b7edd9 on syeutyu:issue-3985 into 1b5cbf1 on mochajs:master.

@juergba
Copy link
Member

juergba commented May 26, 2021

@syeutyu could you rebase to master, please?
I would like to review and then merge for the next release, thank you.

@syeutyu
Copy link
Contributor Author

syeutyu commented May 27, 2021

I have rebased it @juergba

@juergba juergba added the run-browser-test run browser tests on forked PR if code is safe label May 27, 2021
@github-actions github-actions bot removed the run-browser-test run browser tests on forked PR if code is safe label May 27, 2021
Copy link
Member

@juergba juergba left a comment

Choose a reason for hiding this comment

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

@syeutyu thank you for this PR.
I just have two small changes, then it's ready to get merged.

test/reporters/base.spec.js Outdated Show resolved Hide resolved
test/reporters/base.spec.js Show resolved Hide resolved
@syeutyu
Copy link
Contributor Author

syeutyu commented May 28, 2021

@juergba I've updated it.
Thank you for your comment 馃槃

@juergba juergba linked an issue May 28, 2021 that may be closed by this pull request
4 tasks
@juergba juergba changed the title Fix control error message handling (#3985) Fix: control stringification of error message May 28, 2021
@juergba juergba added this to the next milestone May 28, 2021
Copy link
Member

@juergba juergba left a comment

Choose a reason for hiding this comment

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

@syeutyu thank you

@juergba juergba merged commit 1c4e623 into mochajs:master May 28, 2021
@juergba juergba modified the milestones: next, v9.0.0 Jun 7, 2021
@juergba juergba added the semver-patch implementation requires increase of "patch" version number; "bug fixes" label Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: usability concerning user experience or interface semver-patch implementation requires increase of "patch" version number; "bug fixes" type: bug a defect, confirmed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't control stringification of error messages
5 participants