(duration, done, fn)
| 54 | // A function that acts like setTimeout, except with arguments reversed. This |
| 55 | // is far more readable within tests. |
| 56 | function wait(duration, done, fn) { |
| 57 | var handler = function () { |
| 58 | try { |
| 59 | fn(); |
| 60 | } catch (e) { |
| 61 | // Instead of relying on window.onerror to detect an error was |
| 62 | // thrown (which is problematic in IE6-7), we invoke the callback |
| 63 | // with an error the way Mocha expects. |
| 64 | return done(e); |
| 65 | } |
| 66 | }; |
| 67 | return setTimeout(handler, duration); |
| 68 | } |
| 69 | window.wait = wait; |
| 70 | |
| 71 | function buildMessage() { |
no outgoing calls
no test coverage detected