| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent da457a5 commit dbb7a02
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,6 +30,19 @@ const { setUnrefTimeout } = require('internal/timers'); | |||
| 30 | 30 | strictEqual(timer.refresh(), timer); | |
| 31 | 31 | } | |
| 32 | 32 | ||
| 33 | + // should throw with non-functions | ||
| 34 | + { | ||
| 35 | + const expectedError = { | ||
| 36 | + code: 'ERR_INVALID_CALLBACK', | ||
| 37 | + message: 'Callback must be a function' | ||
| 38 | + }; | ||
| 39 | + | ||
| 40 | + [null, true, false, 0, 1, NaN, '', 'foo', {}, Symbol()].forEach((cb) => { | ||
| 41 | + common.expectsError(() => setUnrefTimeout(cb), | ||
| 42 | + expectedError); | ||
| 43 | + }); | ||
| 44 | + } | ||
| 45 | + | ||
| 33 | 46 | // unref pooled timer | |
| 34 | 47 | { | |
| 35 | 48 | let called = false; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments