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

Use EXPECT instead of ASSERT (repeat 582738b) #27850

Closed
wants to merge 2 commits into from

Conversation

Ikuyadeu
Copy link
Contributor

Summary

This change will keep project consistency.
This change repeat the previous commit 582738b.
That was created by @sammy-SC and reviewed by @shergin

That changed

  • ASSERT_TRUE -> EXPECT_TRUE
  • ASSERT_NEAR -> EXPECT_NEAR
  • ASSERT_EQ -> EXPECT_EQ

That said

  1. Replace ASSERT_* with EXPECT_*. Assert is a fatal assertion. Expect is non-fatal assertion. So if assert fails, tests do not continue and therefore provide less information.

  2. Rename tests in RawPropsTest.cpp from ShadowNodeTest to RawPropsTest.

Source: https://github.com/google/googletest/blob/master/googletest/docs/primer.md#basic-assertions

Changelog

[CATEGORY] [TYPE] - Message

Test Plan

@facebook-github-bot
Copy link
Contributor

Hi Ikuyadeu! Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@pull-bot
Copy link

Messages
📖

📋 Verify Changelog Format - A changelog entry has the following format: [CATEGORY] [TYPE] - Message.

CATEGORY may be:
  • General
  • iOS
  • Android
  • JavaScript
  • Internal (for changes that do not need to be called out in the release notes)

TYPE may be:

  • Added, for new features.
  • Changed, for changes in existing functionality.
  • Deprecated, for soon-to-be removed features.
  • Removed, for now removed features.
  • Fixed, for any bug fixes.
  • Security, in case of vulnerabilities.

MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes.

Generated by 🚫 dangerJS against adf7350

@Ikuyadeu Ikuyadeu requested review from sammy-SC and shergin January 24, 2020 02:05
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 24, 2020
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@shergin is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

facebook-github-bot pushed a commit that referenced this pull request Jan 25, 2020
Summary:
This change will keep project consistency.
This change repeat the previous commit 582738b.
That was created by sammy-SC and reviewed by shergin

That changed
* `ASSERT_TRUE` -> `EXPECT_TRUE`
* `ASSERT_NEAR` -> `EXPECT_NEAR`
* `ASSERT_EQ` -> `EXPECT_EQ`

That said
> 1. Replace ASSERT_* with EXPECT_*. Assert is a fatal assertion. Expect is non-fatal assertion. So if assert fails, tests do not continue and therefore provide less information.
>
> 2. Rename tests in `RawPropsTest.cpp` from `ShadowNodeTest` to `RawPropsTest`.
>
> Source: https://github.com/google/googletest/blob/master/googletest/docs/primer.md#basic-assertions

## Changelog

[CATEGORY] [TYPE] - Message
Pull Request resolved: #27850

Differential Revision: D19568014

Pulled By: shergin

fbshipit-source-id: 7c22cd1c7ec919675e834a060bd5e681d43a8baf
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @Ikuyadeu in 0507d73.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Jan 25, 2020
@Ikuyadeu
Copy link
Contributor Author

Ikuyadeu commented Jan 27, 2020

@shergin Thank you for approving and merging!
I made this PR by using DevReplay that distilled the coding pattern from this repo. Please inform me if you have an interest in the facebook/react-native pattern.

@Ikuyadeu Ikuyadeu deleted the assert2expect branch January 27, 2020 02:12
osdnk pushed a commit to osdnk/react-native that referenced this pull request Mar 9, 2020
Summary:
This change will keep project consistency.
This change repeat the previous commit 582738b.
That was created by sammy-SC and reviewed by shergin

That changed
* `ASSERT_TRUE` -> `EXPECT_TRUE`
* `ASSERT_NEAR` -> `EXPECT_NEAR`
* `ASSERT_EQ` -> `EXPECT_EQ`

That said
> 1. Replace ASSERT_* with EXPECT_*. Assert is a fatal assertion. Expect is non-fatal assertion. So if assert fails, tests do not continue and therefore provide less information.
>
> 2. Rename tests in `RawPropsTest.cpp` from `ShadowNodeTest` to `RawPropsTest`.
>
> Source: https://github.com/google/googletest/blob/master/googletest/docs/primer.md#basic-assertions

## Changelog

[CATEGORY] [TYPE] - Message
Pull Request resolved: facebook#27850

Differential Revision: D19568014

Pulled By: shergin

fbshipit-source-id: 7c22cd1c7ec919675e834a060bd5e681d43a8baf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants