Skip to content
Closed
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
Prev Previous commit
Fixed linting
  • Loading branch information
lucamaraschi committed Mar 16, 2017
commit b143d6fd2439eae4f2b5b81a3d1344af4efc3c50
8 changes: 4 additions & 4 deletions test/parallel/test-net-options-lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ const net = require('net');

const expectedError = /^TypeError: "lookup" option should be a function$/;

['foobar', 1, {}, []].forEach(input => connectThrows(input));
['foobar', 1, {}, []].forEach((input) => connectThrows(input));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: how about adding other primitives (boolean, undefined, symbol)?


function connectThrows(input) {
const opts = {
host: 'localhost',
port: common.PORT,
lookup: input,
lookup: input
};

assert.throws(function() {
net.connect(opts);
}, expectedError);
}

[() => {}].forEach(input => connectDoesNotThrow(input));
[() => {}].forEach((input) => connectDoesNotThrow(input));

function connectDoesNotThrow(input) {
const opts = {
host: 'localhost',
port: common.PORT,
lookup: input,
lookup: input
};

assert.doesNotThrow(function() {
Expand Down