Blake VandeMerwe
unread,Jun 7, 2012, 1:41:53 PM6/7/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Jasmine
With the following describe, I get errors in IE and Firefox that say
the spy has already been spied upon..
describe('checkAccelerators', function() {
var e = {
'shiftKey' : false,
'altKey' : true,
'ctrlKey' : true,
'which' : 0
}
beforeEach(function() {
spyOn(jasmine.getGlobal(), 'FunctionKeyF9');
});
it(' calls FunctionKeyF9 with F9 key.', function() {
with(e) {
e.which = 120;
checkAccelerators(e);
expect(FunctionKeyF9).toHaveBeenCalled();
}
});
});
....If I remove the beforeEach, it clears up the errors in Firefox and
IE, but throws errors in Chrome and Safari that say they expected a
spy but received a function.
Can you help me with this please? 3rd day in a row spies have given me
issues...is there some kind of "Further" documentation to read on
spies so I don't have to keep wasting everyone's time?