Skip to content
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(() => clearInterval(null));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you're testing intervals twice? Should these be immediates?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're rightttt!


assert.doesNotThrow(() => clearInterval());