I find myself facing a challenge as I navigate the learning path to nodejs and explore advanced javascript features. Progress is slow but steady. One of the rest endpoints utilizes the (azure blob storage) method from containerclient, which requires converting the results into a different format. When it comes to writing tests using sinon, there is a need to stub/mock/fake this method along with its return values. As I iterate through the Blobitem objects in my rest endpoint.
listBlobsByHierarchy(string, ContainerListBlobsOptions)
This method yields
PagedAsyncIterableIterator<({ kind: "prefix"; } & BlobPrefix) | ({ kind: "blob"; } & BlobItem), ContainerListBlobHierarchySegmentResponse>
The question arises - how should I proceed with this task? If I mock this method and alter its return value, what steps should I take next?
To learn more, check out the following reference link: ContainerClient.listBlobsByHierarchy