Or better yet would be to break the calls to the paths down into specific functions then mock the results
Let’s say you were uploading a file and wanted the path to your uploads directory, then I would have a small utility method like below and then you can mock that.
function getFileUploadPath() {
return expandPath(‘/uploads’);
}
Rather than just a blanket function to duplicate the expandPath.