Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
NavigationDrawer - window.matchMedia is not a function in some scenarios using jest #783
Hi @mlaursen and react-md team, how you doing?.
Thanks for the amazing contribution with this frontend lib. Its has been useful for my project.
I appreciate your time in reading this issue description.
I'm trying to create the unit testing for one of the container using jest as the testing lib. When i run this test i have receiving this error.
I isolated the unite testing and the react-md implementation in a new create-react-app project, but when i run the test I still receiving the same issue. So I don't know if it something I'm doing wrong or I missing something. It seems like this only happening with NavigationDrawer or Drawer Implementation.
I'll appreciate your time and help.
See img bellow with the error
Link to a gist or code sample where the issue can be reproduced
The issue can not reproduced, because id did find out how to run the jest in codepen using create-react-app as a template. But you can see the test commented on the bottom if the js file.
Code in gist
Oh, I think I ran into this problem before with my documentation server tests. I ended up using a setup script to mock this since some testing environments don't have
I can update the testing page on the documentation site to add these cases.
Hi @mlaursen, how you doing man?
Thanks for your quick answer.
Yes, I see know. Inspecting the Drawer.js code i get to find out that. As how you mention, It's a good idea to add this scenarios as a test case.
Thanks for the solution you shared with me, I have not received any more this bug.
I appreciate your help man.