My question is simple. I want to mock a method ONLY if a certain value is passed to the method. Something like this:
spyOn(myObj, "getUser").and.withArgs('userA').and.returnValue(null);
If the method getUser is invoked with the value 'userA', the method should return null.
Is that possibly with Jasmine? I'm using Karma with jasmine-core": "^2.6.1 and jasmine-jquery": "^2.1.1"