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

Adding operator attribute to assertion error #1257

Merged
merged 9 commits into from
Jun 25, 2019
Merged

Adding operator attribute to assertion error #1257

merged 9 commits into from
Jun 25, 2019

Conversation

@codecov
Copy link

codecov bot commented May 23, 2019

Codecov Report

Merging #1257 into master will increase coverage by 0.09%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1257      +/-   ##
=========================================
+ Coverage   94.51%   94.6%   +0.09%     
=========================================
  Files          32      33       +1     
  Lines        1677    1705      +28     
  Branches      405     415      +10     
=========================================
+ Hits         1585    1613      +28     
  Misses         92      92
Impacted Files Coverage Δ
lib/chai/utils/index.js 100% <100%> (ø) ⬆️
lib/chai/assertion.js 100% <100%> (ø) ⬆️
lib/chai/utils/getOperator.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6441f3d...4dbeef1. Read the comment docs.

@rpgeeganage
Copy link
Contributor Author

closing till I add tests.

@rpgeeganage rpgeeganage reopened this May 24, 2019
@rpgeeganage
Copy link
Contributor Author

@keithamus ,
Please take a peek when you have time, I have added the requested changes in #1253.
Thanks a lot.

Copy link
Member

@lucasfcosta lucasfcosta left a comment

Choose a reason for hiding this comment

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

Hi, @rpgeeganage, 😊

Thanks for the amazing PR, the code looks really good. I just pointed out some details that I think are worth correcting, but I'd love to get this in. Please let me know if I missed something or if there's anything else I can help you with.

Best,
Lucas

lib/chai/assertion.js Outdated Show resolved Hide resolved
lib/chai/assertion.js Outdated Show resolved Hide resolved
lib/chai/utils/getOperator.js Outdated Show resolved Hide resolved
lib/chai/utils/getOperator.js Outdated Show resolved Hide resolved
lib/chai/utils/getOperator.js Outdated Show resolved Hide resolved
test/globalErr.js Show resolved Hide resolved
test/utilities.js Show resolved Hide resolved
test/utilities.js Outdated Show resolved Hide resolved
test/utilities.js Outdated Show resolved Hide resolved
@rpgeeganage
Copy link
Contributor Author

rpgeeganage commented May 30, 2019

@lucasfcosta,
Thank you for reviewing and your valuable comments. I fixed them all and added test cases for array and function.

lucasfcosta
lucasfcosta previously approved these changes Jun 2, 2019
Copy link
Member

@lucasfcosta lucasfcosta left a comment

Choose a reason for hiding this comment

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

This LGTM, thank you very much 😊!

Can someone from @chaijs/core give this a last pass?

@astorije
Copy link
Member

astorije commented Jun 3, 2019

Is there something plugin authors who add assertions to the core library (yes I am biased lol) will need to do to support this? If so, does not updating plugins break something, or does it degrade gracefully?

Cheers! 🙏

@keithamus
Copy link
Member

@astorije My hope is that this degrades gracefully, but if you want to support it in your plugin you can set via flag(this, 'operator', MYOPERATOR). Flags are backwards compat (in that its just a set and so it becomes a noop on earlier versions that don't know about the key)

Copy link
Member

@astorije astorije left a comment

Choose a reason for hiding this comment

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

Nice job!

@astorije
Copy link
Member

astorije commented Jun 9, 2019

if you want to support it in your plugin you can set via flag(this, 'operator', MYOPERATOR)

I think it would be valuable to have steps listed in the release notes on 1) how to set this in your plugins if necessary and 2) how to check that it worked. Authors may not be familiar with Jest, so being able to correctly assess if that did it or if that's even required at all would be helpful I think.

Either way, nice addition! 🙏

@rpgeeganage
Copy link
Contributor Author

Hi everyone,
Thank you for valuable comments and reviews.
Are there any modifications required in this PR?

@lucasfcosta
Copy link
Member

Hello @rpgeeganage, I don't think there's any change to the code which is necessary, but as @astorije maybe worth adding information for plugin developers explaining how to use this flag.

Since that can go in the release notes as @astorije recommended I think it's enough to add a brief explanation in the commit body so that we can include it in the release.

I'm happy to get this in as is and the explanation in the commit's body would be very nice.

@rpgeeganage
Copy link
Contributor Author

@lucasfcosta ,
Thanks for approving the PR.
Where will be a good place to add a description regarding the 'operator' flag?

@lucasfcosta
Copy link
Member

Hi @rpgeeganage, sorry I think my comment was a bit confusing.

Just add it to the body of the commit and we will add it to the release notes when creating the release.

A git commit --amend will open the editor for you to type a message in the first line, then you can keep the same message and jump a line so that you can start writing the commit body.

@rpgeeganage
Copy link
Contributor Author

@lucasfcosta ,
Thank you so much for the information. I'll do this asap.

This was referenced Mar 15, 2021
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.

5 participants