Skip to content

Commit

Permalink
test: increase coverage for timers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
lrlna authored and addaleax committed Dec 8, 2016
1 parent e14a597 commit f1d0bf4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/parallel/test-timers-clear-null-does-not-throw-error.js
Original file line number Diff line number Diff line change
@@ -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());

0 comments on commit f1d0bf4

Please sign in to comment.