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
186 stars 19 forks source link

Broken with React 16.5.0 #53

Closed albertfdp closed 6 years ago

albertfdp commented 6 years ago

Hi,

When upgrading to react 16.5.0, all tests fail.

It seems to be due to react-render-hook. All tests are fixed there when bumping to the latest commit on the submodule react-devtools. https://github.com/albertfdp/react-render-hook/commits/fix/react-devtools (I can open this PR if this is the solution).

I have tried then running the tests on unexpected-react using this fork, and most of the tests are fixed, however, I get many errors with

Error: EEXIST, file already exists '/path/to/tests/__snapshots__'

Which I can't understand what is the issue. If you could guide me on the right direction, I can submit a PR with the fix, as this is blocking to upgrade to 16.5.0.

Thanks

bruderstein commented 6 years ago

Thanks for reporting. Updating devtools sounds like the way to go. The file already exists error is a timing race condition in the tests that I've never got to the bottom of - maybe it's triggered more often now.

PR would be awesome, but otherwise I'll fix it

albertfdp commented 6 years ago

Thanks!

I tried looking into the file issue, but I didn't know where to start, it seems to happen in https://github.com/bruderstein/unexpected-react/blob/master/src/helpers/snapshots.js#L107

I have opened a PR on react-render-hook.

ingmarh commented 6 years ago

We also had a lot of failing tests after updating to React 16.5.2. However, these tests did work again after updating to the recently released React 16.6.0.

bruderstein commented 6 years ago

@albertfdp 's PR to react-render-hook was merged and the version of react-render-hook was bumped in unexpected-react 5.0.2