0

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?

Geoff Kabule
  • 139
  • 2
  • 11

1 Answers1

0

The solution turns out that I need to create a spy object on the constructor Excel.Workbook(). This should give me the object to spy on the methods

Geoff Kabule
  • 139
  • 2
  • 11