Closed michayou closed 8 months ago
Your example doesn't indicate how you hooked the mock data object up, but I'm assume you are running code that creates the excelMock out of the MockData object and assigning it to the global excel object. All you would have to do is create a "fresh state" by assigning the global excel object a fresh excel mock object.
The mock object is not intended to be fully functional (which would require the actual Excel host and office.js); it's meant to be an interface to allow test data to be passed and only track the load and sync calls. Being able to reset that state seems like a nice improvement. You could suggest that improvement on https://aka.ms/M365dev-suggestions or contribute to this repo yourself (we welcome community involvement).
Expected behavior
If you have two instances of Excel.run where you get a range and then use range.load, the second one will not load items loaded by the first run
Current behavior
In the mock the second instance of Excel.run will contain items loaded by the first one.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
now try running those two Excel.run commands in a function in an Excel plug in. range.rowCount range.columnCount will not have been loaded in the second one
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.