Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: refactor domain tests #13480

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions test/parallel/test-domain-crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ global.domain = require('domain');

// should not throw a 'TypeError: undefined is not a function' exception
crypto.randomBytes(8);
crypto.randomBytes(8, common.noop);
crypto.randomBytes(8, common.mustCall());
const buf = Buffer.alloc(8);
crypto.randomFillSync(buf);
crypto.pseudoRandomBytes(8);
crypto.pseudoRandomBytes(8, common.noop);
crypto.pbkdf2('password', 'salt', 8, 8, 'sha1', common.noop);
crypto.pseudoRandomBytes(8, common.mustCall());
crypto.pbkdf2('password', 'salt', 8, 8, 'sha1', common.mustCall());
2 changes: 1 addition & 1 deletion test/parallel/test-domain-timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ immediated.run(function() {
});
});

const timeout = setTimeout(common.noop, 10 * 1000);
const timeout = setTimeout(common.mustNotCall(), 10 * 1000);
2 changes: 1 addition & 1 deletion test/parallel/test-domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ const fst = fs.createReadStream('stream for nonexistent file');
d.add(fst);
expectCaught++;

[42, null, , false, common.noop, 'string'].forEach(function(something) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it was meant to add undefined?
Also re: #12822 /s/common.noop/() => {}/

Copy link
Member Author

@Trott Trott Jun 5, 2017

Choose a reason for hiding this comment

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

Ack, done, thanks!

[42, null, false, common.noop, 'string'].forEach(function(something) {
const d = new domain.Domain();
d.run(function() {
process.nextTick(function() {
Expand Down