私はこのようなテストを書きます
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