I am using a third party npm library - exceljs to generate excel reports. The library has a function to write the generated file to disk.
Here is some code snippet
const workbook: Excel.Workbook = new Excel.Workbook();
// code to generate the report - not an issue
workbook.xlsx.writeFile(path).then(...).catch(...)
My question is how can I spy on writeFile() using jasmine?