Esri / arcgis-rest-js

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

feat: user app resources; tests use spyOn #1136

Closed dbouwman closed 11 months ago

dbouwman commented 1 year 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 11 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 11 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.