Hi,
I am trying to port Jasmine to an environment that doesn't support setTimeout (or at least one that only accepts a string, not a function).
I expected some functionality to be unavailable but was happy if I could get some basic stuff which seems to work fine ... except in
function clearStack(fn) {
currentSpecCallbackDepth++;
if (currentSpecCallbackDepth >= maximumSpecCallbackDepth) {
currentSpecCallbackDepth = 0;
realSetTimeout(fn, 0);
} else {
fn();
}
}
Because maximumSpecCallbackDepth has a value of 20 that becomes the limit of the number of specs I can have.
I don't really understand this code but as a work around I have moved maximumSpecCallbackDepth to a property of the jasmine object (there seemed to be others in the base function). So I now have
j$.MAXIMUM_SPEC_CALLBACK_DEPTH which I can update in my bootstrape code, seems fine at 2000.
It would be nice if I didn't need to make this change each update to Jasmine and it seems to be good to remove the magic number 20 anyway but as I'm not sure about this code, I would appreciate some advice.
Thanks
Bruce