Hello...
I've had to do unittesting in Java Nashorn of business logic. Since
there's no concept of asynchronous in our JavaScript wrapper, hence no
setTimeout, I modified lib/jasmine-core/jasmine.js to accept a world
without setTimeout (patch attached).
Basically this tests for existence of setTimeout, and if no such thing,
calls immediately when making the clearStack() function. And uses same
type of test to filter out calls to attemptAsync().
Yours