1
我寫這樣茉莉花間諜document.execCommand不叫
describe('execCommand', function() {
it('should call document.execCommand', function() {
spyOn(document, 'execCommand').and.callThrough();
expect(document.execCommand).toHaveBeenCalledWith('foreColor', false, 'red');
document.execCommand('foreColor', false, 'red');
});
});
測試但未能Expected spy execCommand to have been called with [ 'foreColor', false, 'red' ] but it was never called.
,我不知道爲什麼?
請幫忙。
注:我運行它使用grunt-contrib-jasmine
0.9.2