Open tomwayson opened 4 years ago
Probably should try react-hooks-testing-library.
If that doesn't work, looks like the best approach is to have the tests create a component that uses the hooks and then do a rendering test on the component with react-testing-library.
In either case will want to mock either the functions in utils/arcgis or esriLoader.loadModules itself.
esriLoader.loadModules
More resources
https://blog.bitsrc.io/how-to-create-and-test-react-custom-hooks-927fe468c361 https://medium.com/@nitinpatel_20236/unit-testing-custom-react-hooks-caa86f58510
Probably should try react-hooks-testing-library.
If that doesn't work, looks like the best approach is to have the tests create a component that uses the hooks and then do a rendering test on the component with react-testing-library.
In either case will want to mock either the functions in utils/arcgis or
esriLoader.loadModules
itself.