I have the following code
import {
getIndexDocument
} from "@assets";
class MetaController {
public async exploreIndexDocument(): Promise<Asset | undefined> {
const {
result: { assignedDirectories }
} = await getIndexDocument(this._serviceConfig).catch(err => {
throw new Error(`[AssetsController] Bad response on discovering index doc because ${err}`);
});
}
}
As you can see the exploreIndexDocument is calling function getIndexDocument. I want to write a test for exploreIndexDocument, but I can't stub getIndexDocument using sinon because sinon does not allow you to stub functions. How do I architecture this class to do so?