Limenius / ReactRenderer

Client and Server-side React rendering from PHP
MIT License
238 stars 37 forks source link

Added test with real bundle containing react-on-rails #6

Closed teameh closed 7 years ago

teameh commented 7 years ago

This test proves the issue fixed by https://github.com/Limenius/ReactRenderer/pull/3

Expected output looks like:

PHPUnit 5.5.4 by Sebastian Bergmann and contributors.

...E.                                                               5 / 5 (100%)

Time: 281 ms, Memory: 12.75MB

There was 1 error:

1) Limenius\ReactRenderer\Tests\Renderer\PhpExecJsReactRendererTest::testReactOnRails
RuntimeException: Something went wrong evaluating JS code:
result: "TypeError: Cannot read property 'replace' of undefined"

ReactRenderer/vendor/nacmartin/phpexecjs/src/Nacmartin/PhpExecJs/Runtime/ExternalRuntime.php:286
ReactRenderer/vendor/nacmartin/phpexecjs/src/Nacmartin/PhpExecJs/Runtime/ExternalRuntime.php:102
ReactRenderer/vendor/nacmartin/phpexecjs/src/Nacmartin/PhpExecJs/PhpExecJs.php:48
ReactRenderer/src/Limenius/ReactRenderer/Renderer/PhpExecJsReactRenderer.php:80
ReactRenderer/tests/Limenius/ReactRenderer/Tests/Renderer/PhpExecJsReactRendererTest.php:86

ERRORS!
Tests: 5, Assertions: 4, Errors: 1.

This test won't fail when https://github.com/Limenius/ReactRenderer/pull/3 is merged