bruderstein / unexpected-react

Plugin for http://unexpected.js.org to enable testing the full React virtual DOM, and also the shallow renderer
http://bruderstein.github.io/unexpected-react
MIT License
187 stars 19 forks source link

Fix comments in snapshots #38

Closed bruderstein closed 7 years ago

bruderstein commented 7 years ago

Snapshots were being written with comments with raw JSON rather than the JSX. They were being identified as the RawReactTestRendererJson when inspect ran, which meant the raw JSON was outputted. Now they are identified correctly.

I think because of the new hierarchy, it now actually outputs correctly in the test, but we need @sunesimonsen's fix to properly fix this - I'm not sure what combination is actually making this work - the RawReactTestRendererJson doesn't have an inspect method.

sunesimonsen commented 7 years ago

Sorry but this does really fix the problem that I'm seeing at all. If I have multiple snapshots in one file and I update one of them, the rest will be rendered as raw JS objects. This still happens.

Do I need this in combination with my #37?

sunesimonsen commented 7 years ago

One thing to keep in mind, is that I'm using the deep renderer.

bruderstein commented 7 years ago

Merged, because now it has failing tests - this is actually fixed in #37