Skip to content

Commit e21e129

Browse files
lrlnasilverwind
authored andcommitted
test: increase coverage for timers
Add a test for cancelling timers with null or no arguments. PR-URL: #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>
1 parent 384dafe commit e21e129

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict';
2+
require('../common');
3+
const assert = require('assert');
4+
5+
// This test makes sure clearing timers with
6+
// 'null' or no input does not throw error
7+
8+
assert.doesNotThrow(() => clearInterval(null));
9+
10+
assert.doesNotThrow(() => clearInterval());
11+
12+
assert.doesNotThrow(() => clearTimeout(null));
13+
14+
assert.doesNotThrow(() => clearTimeout());
15+
16+
assert.doesNotThrow(() => clearImmediate(null));
17+
18+
assert.doesNotThrow(() => clearImmediate());

0 commit comments

Comments
 (0)