mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
test: increase coverage for timers
Add a test for cancelling timers with null or no arguments. PR-URL: https://github.com/nodejs/node/pull/10068 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
This commit is contained in:
1 parent
384dafe4c9
commit
e21e12944c
1 file changed
+18
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
require('../common');
|
||||
const assert = require('assert');
|
||||
|
||||
// This test makes sure clearing timers with
|
||||
// 'null' or no input does not throw error
|
||||
|
||||
assert.doesNotThrow(() => clearInterval(null));
|
||||
|
||||
assert.doesNotThrow(() => clearInterval());
|
||||
|
||||
assert.doesNotThrow(() => clearTimeout(null));
|
||||
|
||||
assert.doesNotThrow(() => clearTimeout());
|
||||
|
||||
assert.doesNotThrow(() => clearImmediate(null));
|
||||
|
||||
assert.doesNotThrow(() => clearImmediate());
|
||||
Reference in new issue
Block a user