Skip to content

feat: add debug to render helpers for easier console debugging #65

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

Merged
merged 5 commits into from
Nov 19, 2018

Conversation

thymikee
Copy link
Member

@thymikee thymikee commented Nov 18, 2018

Summary

Adds debug and debug.shallow to render helpers to render. It's way more convenient than importing debug from the library, and feeding the component/json output to it. Plus it aligns well with react-testing-library's debug. Also improved the custom message by adding it to the top for easier discovery. Added docs say it all:

const { debug } = render(<Component />);

debug('optional message');

logs optional message and colored JSX:

optional message

<TouchableOpacity
  activeOpacity={0.2}
  onPress={[Function bound fn]}
>
  <Text>Press me</Text>
</TouchableOpacity>

Test plan

Included, some adjusted.

@thymikee thymikee requested a review from Esemesek November 18, 2018 16:13
Copy link
Collaborator

@Esemesek Esemesek left a comment

Choose a reason for hiding this comment

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

:)

@Esemesek Esemesek merged commit 909916e into master Nov 19, 2018
@Esemesek Esemesek deleted the feat/renderDebug branch November 19, 2018 12:51
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.

2 participants