From a5c78a2de629699b905acdb80e74b493f76625d7 Mon Sep 17 00:00:00 2001 From: lrlna Date: Thu, 1 Dec 2016 12:04:27 -0600 Subject: [PATCH 1/4] test: increase coverage for timers --- ...t-timers-clear-null-does-not-throw-error.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/parallel/test-timers-clear-null-does-not-throw-error.js diff --git a/test/parallel/test-timers-clear-null-does-not-throw-error.js b/test/parallel/test-timers-clear-null-does-not-throw-error.js new file mode 100644 index 00000000000000..6ae282216dc968 --- /dev/null +++ b/test/parallel/test-timers-clear-null-does-not-throw-error.js @@ -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(() => { clearInterval(null) }); + +assert.doesNotThrow(() => { clearInterval() }); From 70da42b938be86fcc12234ca27f4a5fbfa10702e Mon Sep 17 00:00:00 2001 From: lrlna Date: Thu, 1 Dec 2016 13:38:22 -0600 Subject: [PATCH 2/4] fix linting errors --- .../test-timers-clear-null-does-not-throw-error.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-timers-clear-null-does-not-throw-error.js b/test/parallel/test-timers-clear-null-does-not-throw-error.js index 6ae282216dc968..cbeb9f4570c670 100644 --- a/test/parallel/test-timers-clear-null-does-not-throw-error.js +++ b/test/parallel/test-timers-clear-null-does-not-throw-error.js @@ -5,14 +5,14 @@ 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(null);}); -assert.doesNotThrow(() => { clearInterval() }); +assert.doesNotThrow(() => { clearInterval();}); -assert.doesNotThrow(() => { clearTimeout(null) }); +assert.doesNotThrow(() => { clearTimeout(null);}); -assert.doesNotThrow(() => { clearTimeout() }); +assert.doesNotThrow(() => { clearTimeout();}); -assert.doesNotThrow(() => { clearInterval(null) }); +assert.doesNotThrow(() => { clearInterval(null);}); -assert.doesNotThrow(() => { clearInterval() }); +assert.doesNotThrow(() => { clearInterval();}); From 3db67892ba4d8ce19625dcb9956b7116922bb780 Mon Sep 17 00:00:00 2001 From: lrlna Date: Thu, 1 Dec 2016 15:02:34 -0600 Subject: [PATCH 3/4] add changes requested by @fishrock123 --- .../test-timers-clear-null-does-not-throw-error.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-timers-clear-null-does-not-throw-error.js b/test/parallel/test-timers-clear-null-does-not-throw-error.js index cbeb9f4570c670..f47f5103f3ef12 100644 --- a/test/parallel/test-timers-clear-null-does-not-throw-error.js +++ b/test/parallel/test-timers-clear-null-does-not-throw-error.js @@ -5,14 +5,14 @@ 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(null)); -assert.doesNotThrow(() => { clearInterval();}); +assert.doesNotThrow(() => clearInterval()); -assert.doesNotThrow(() => { clearTimeout(null);}); +assert.doesNotThrow(() => clearTimeout(null)); -assert.doesNotThrow(() => { clearTimeout();}); +assert.doesNotThrow(() => clearTimeout()); -assert.doesNotThrow(() => { clearInterval(null);}); +assert.doesNotThrow(() => clearInterval(null)); -assert.doesNotThrow(() => { clearInterval();}); +assert.doesNotThrow(() => clearInterval()); From 5cc4b0b7b9e1c7efb7591f8c6428c8fb895edf0c Mon Sep 17 00:00:00 2001 From: lrlna Date: Fri, 2 Dec 2016 11:34:09 -0600 Subject: [PATCH 4/4] don't test clear interval twice --- test/parallel/test-timers-clear-null-does-not-throw-error.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-timers-clear-null-does-not-throw-error.js b/test/parallel/test-timers-clear-null-does-not-throw-error.js index f47f5103f3ef12..a15072a4c63f46 100644 --- a/test/parallel/test-timers-clear-null-does-not-throw-error.js +++ b/test/parallel/test-timers-clear-null-does-not-throw-error.js @@ -13,6 +13,6 @@ assert.doesNotThrow(() => clearTimeout(null)); assert.doesNotThrow(() => clearTimeout()); -assert.doesNotThrow(() => clearInterval(null)); +assert.doesNotThrow(() => clearImmediate(null)); -assert.doesNotThrow(() => clearInterval()); +assert.doesNotThrow(() => clearImmediate());