10 lines
207 B
JavaScript
10 lines
207 B
JavaScript
var timeLimit = Date.now() + 5000;
|
|
|
|
assert.equal((function f(n) {
|
|
assert.operator(Date.now(), '<', timeLimit, "Timeout");
|
|
if (n <= 0) {
|
|
return "foo";
|
|
}
|
|
return f(n - 1);
|
|
})(1e6), "foo");
|