xrm-mock
xrm-mock copied to clipboard
How to stub Xrm.Navigation.navigateTo() function?
I see in /src/xrm-mock/navigation/navigation.mock.ts that not all Xrm.Navigation functions are mocked. There's an error message suggesting to use Sinon.JS to stub certain functions, which I am attempting by attempting a very simple test:
it("should stub Xrm.Navigation.navigateTo", function() {
const navigateToStub = sinon.stub(Xrm.Navigation, "navigateTo");
});
This results in the following error:
TypeError: Cannot stub non-existent property navigateTo
It's not a deal-breaker even though the method under test navigates to a different entity after a specific function succeeds. It's just out of curiosity that I am trying to figure out how one might stub a function that is not implemented by xrm-mock just yet.
I already done in my repo. Let I do PR.
Did this ever get done @phuocle ?