no-arbitrary-setTimeout.rst (613B)
1 no-arbitrary-setTimeout 2 ======================= 3 4 Disallows setTimeout with non-zero values in tests. Using arbitrary times for 5 setTimeout may cause intermittent failures in tests. A value of zero is allowed 6 as this is letting the event stack unwind, however also consider the use 7 of ``TestUtils.waitForTick``. 8 9 Examples of incorrect code for this rule: 10 ----------------------------------------- 11 12 .. code-block:: js 13 14 function(aFoo, aBar) {} 15 (aFoo, aBar) => {} 16 17 Examples of correct code for this rule: 18 --------------------------------------- 19 20 .. code-block:: js 21 22 function(foo, bar) {} 23 (foo, bar) => {})