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 #1253

Closed
wants to merge 3 commits into from
Closed

Adding operator attribute to assertion error #1253

wants to merge 3 commits into from

Conversation

@rpgeeganage rpgeeganage marked this pull request as ready for review May 19, 2019 13:09
@rpgeeganage rpgeeganage requested a review from a team as a code owner May 19, 2019 13:09
@codecov
Copy link

codecov bot commented May 19, 2019

Codecov Report

Merging #1253 into master will increase coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1253      +/-   ##
=========================================
+ Coverage   94.51%   94.6%   +0.08%     
=========================================
  Files          32      33       +1     
  Lines        1677    1704      +27     
  Branches      405     417      +12     
=========================================
+ Hits         1585    1612      +27     
  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...8ebf1d5. Read the comment docs.

@rpgeeganage
Copy link
Contributor Author

@keithamus ,
Can you please take a peek and give feedback on this when you have time.
(I haven't added any tests yet, I'll add tests when reviewers are fine with the PR).

@keithamus
Copy link
Member

keithamus commented May 22, 2019

The only normative specification of operator is that it is a string right? While I'm fine to default most instances to one of [not][deep][strict]Equal I also think we should provide a mechanism for allowing the operator to be overridden in the assertion.

To me it makes most sense to use flag(this, 'operator') and simply have it default to using getOperator if not present. This way if we find mismatches they're easy to fix by just setting the flag.

That is to say: conceptually this is fine. Let's add flag support, and then that + tests will get a ✅ from me 😄

@rpgeeganage
Copy link
Contributor Author

@keithamus,
Thanks a lot. I'll do the changes.

@rpgeeganage
Copy link
Contributor Author

I'm very sorry that,
I have screwed up the branch. so I'm closing this PR and will open a new PR.

@rpgeeganage
Copy link
Contributor Author

#1257

@rpgeeganage rpgeeganage deleted the add_operator_to_assertion_error branch May 23, 2019 23:40
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