Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ad07c46

Browse filesBrowse files
Trottaddaleax
authored andcommitted
test: refactor domain tests
* Check that noop callback is or isn't invoked as appropriate using common.mustCall() and common.mustNotCall() * Fix typo in array literal PR-URL: #13480 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent fe5ea3f commit ad07c46
Copy full SHA for ad07c46

File tree

Expand file treeCollapse file tree

3 files changed

+6
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+6
-6
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-domain-crypto.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-domain-crypto.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ global.domain = require('domain');
3737

3838
// should not throw a 'TypeError: undefined is not a function' exception
3939
crypto.randomBytes(8);
40-
crypto.randomBytes(8, common.noop);
40+
crypto.randomBytes(8, common.mustCall());
4141
const buf = Buffer.alloc(8);
4242
crypto.randomFillSync(buf);
4343
crypto.pseudoRandomBytes(8);
44-
crypto.pseudoRandomBytes(8, common.noop);
45-
crypto.pbkdf2('password', 'salt', 8, 8, 'sha1', common.noop);
44+
crypto.pseudoRandomBytes(8, common.mustCall());
45+
crypto.pbkdf2('password', 'salt', 8, 8, 'sha1', common.mustCall());
Collapse file

‎test/parallel/test-domain-timers.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-domain-timers.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ immediated.run(function() {
5151
});
5252
});
5353

54-
const timeout = setTimeout(common.noop, 10 * 1000);
54+
const timeout = setTimeout(common.mustNotCall(), 10 * 1000);
Collapse file

‎test/parallel/test-domain.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-domain.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'use strict';
2323
// Simple tests of most basic domain functionality.
2424

25-
const common = require('../common');
25+
require('../common');
2626
const assert = require('assert');
2727
const domain = require('domain');
2828
const events = require('events');
@@ -259,7 +259,7 @@ const fst = fs.createReadStream('stream for nonexistent file');
259259
d.add(fst);
260260
expectCaught++;
261261

262-
[42, null, , false, common.noop, 'string'].forEach(function(something) {
262+
[42, null, undefined, false, () => {}, 'string'].forEach(function(something) {
263263
const d = new domain.Domain();
264264
d.run(function() {
265265
process.nextTick(function() {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.