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

Chai assert matchers #144

Merged
merged 8 commits into from
Dec 13, 2018
Merged

Chai assert matchers #144

merged 8 commits into from
Dec 13, 2018

Conversation

bcmarinacci
Copy link
Contributor

@bcmarinacci bcmarinacci commented Dec 13, 2018

This pull request adds matchers (and tests) for the following Chai assert matchers:

  • deepProperty
  • notDeepProperty
  • deepPropertyVal
  • notDeepPropertyVal
  • deepPropertyNotVal
  • notPropertyVal

I made a tiny repl to ensure the Jest conversions were valid: https://repl.it/repls/TurboRunnyApplicationsuite.

I also noticed that propertyNotVal is actually shown as notPropertyVal in the Chai documentation: https://www.chaijs.com/api/assert/#method_notpropertyval. I changed the method name to match the Chai docs but I am happy to revert that commit if propertyNotVal was actually the correct method name. (Reverted and added as a new method)

@codecov-io
Copy link

codecov-io commented Dec 13, 2018

Codecov Report

Merging #144 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #144      +/-   ##
==========================================
+ Coverage   94.89%   94.96%   +0.07%     
==========================================
  Files          24       24              
  Lines        1233     1251      +18     
==========================================
+ Hits         1170     1188      +18     
  Misses         63       63
Impacted Files Coverage Δ
src/transformers/chai-assert.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 17230a2...ce55f91. Read the comment docs.

@skovhus
Copy link
Owner

skovhus commented Dec 13, 2018

Thanks. About the last commit:

According to chai changelog propertyNotVal and assert. deepPropertyNotVal assertions were renamed to assert.notPropertyVal and assert.

So we shouldn’t remove that property, but also support the new name.

@bcmarinacci
Copy link
Contributor Author

@skovhus Ah, nice find! Sorry about that. I reverted the last commit and added conversions/tests for notPropertyVal and deepPropertyNotVal.

Copy link
Owner

@skovhus skovhus left a comment

Choose a reason for hiding this comment

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

Thank you! 🙌

@skovhus skovhus merged commit 61d5aba into skovhus:master Dec 13, 2018
@bcmarinacci bcmarinacci deleted the chai-assert-matchers branch December 13, 2018 09:21
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.

3 participants