jasmine: spyOn(obj, 'method').andCallFake or and.callFake?
问题 I want to mock test data in my Jasmine tests. Here are two versions: // version 1: spyOn(mBankAccountResource, 'getBankAccountData').and.callFake(fakedFunction); // version 2: spyOn(mBankAccountResource, 'getBankAccountData').andCallFake(fakedFunction); When I execute my tests with a browser (Chrome, Firefox) then the first version works. However, when I run the same test with phantomjs, I have to use the second version. Otherwise, it complains that the function is not defined. Here are the