Esri / arcgis-rest-js

compact, modular JavaScript wrappers for the ArcGIS REST API
https://developers.arcgis.com/arcgis-rest-js/
Apache License 2.0
347 stars 119 forks source link

feat: user app resources; tests use spyOn #1136

Closed dbouwman closed 9 months ago

dbouwman commented 11 months ago

This adds functions for working with user app resources. These functions are copied from hub.js, along with the tests.

NOTE

The tests included use spyOn to create jasmine spies for request. This does not work in this project!

dbouwman commented 9 months ago

Main question here is: Can we use spies in here or must we mock all the calls? Hub is already using these fns, but to land in here we'd need to spend time changing the tests... which is hard to fit into my task list

Also - make sure we export the fns from the package

dbouwman commented 9 months ago

Fundamentally, we can't use spies in rest-js b/c it's using typescript 3.9+, which marks module properties as read only, precluding the use of jasmine spies. In order to merge this, all the tests needs to be re-worked to use fetchMock. At this time none of us have bandwidth to tackle this. Closing.