Skip to content

feat: add toJSON to render; cleanup shallow #35

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
Oct 16, 2018
Merged

Conversation

thymikee
Copy link
Member

Summary

Exposing toJSON so it's possible to snapshot/debug the fully rendered component.
By the way removed the dead code in shallow that was not supported (we've never actually wanted to support shallow(Component) as it doesn't make sense without passing props.

Fixes #33.

Test plan

Added a test, which renders funny because of our mocks.

@thymikee thymikee requested a review from Esemesek October 16, 2018 15:39
src/debug.js Outdated
@@ -1,7 +1,7 @@
// @flow
import * as React from 'react';
import prettyFormat, { plugins } from 'pretty-format'; // eslint-disable-line import/no-extraneous-dependencies
import shallow from './shallow';
import { shallow } from '.';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this a cyclic dependency?

Copy link
Member Author

Choose a reason for hiding this comment

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

hm, yea, reverting

@Esemesek
Copy link
Collaborator

Can you also update documentation?

@thymikee thymikee merged commit 07d3be1 into master Oct 16, 2018
@thymikee thymikee deleted the feat/to-json branch October 16, 2018 16:00
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