Open pjaws opened 2 years ago
Same problem here. As soon as I use "react-player/lazy" instead of "react-player/youtube" or "react-player" jest tests using react-testing-library fail with segmentation fault.
Same here.
Is anyone able to find the solution to this?
Same here.
My solution is to replace react-player/lazy
module with react-player
in your jest setup file:
// Replace react-player/lazy with react-player
// Fix Segmentation Fault when using 'react-player/lazy' in tests
// Learn more: https://github.com/cookpete/react-player/issues/1391
jest.mock('react-player/lazy', () => {
return jest.requireActual('react-player');
});
Having the same issue. I fixed it for now with @F3n67u solution but I was wondering if it will be fixed officially.
Be sure to search for your issue before opening a new one.
Current Behavior
Importing
ReactPlayer
fromreact-player/lazy
causes a segmentation fault when rendered with@testing-library/react
inside a Jest test.Importing from
react-player/vimeo
does not produce the same issue.Expected Behavior
:)
Steps to Reproduce
video.js
video.spec.js
results in:
Environment