In my production code I have a function which is blocking program for 10 ms (because of use execSync). In my test I used testdouble.js library to stub it:
td.when(getSignalStrength()).thenReturn.apply(null, array);
However stub is responding immediately and in reality function getCurrentSignalStrength is responding after 10 ms. I would like to delay the answer of stub so test would be more similar to reality. I read documentation of testdouble.js: https://github.com/testdouble/testdouble.js/blob/master/docs/5-stubbing-results.md#delay but unfortunately it seems that delay option is not available for thenReturn method. So how to delay stub answer?