1'use strict';
2
3require('../common');
4const assert = require('assert');
5const net = require('net');
6
7// Tests that net.connect() called without arguments throws ERR_MISSING_ARGS.
8
9assert.throws(() => {
10  net.connect();
11}, {
12  code: 'ERR_MISSING_ARGS',
13  message: 'The "options" or "port" or "path" argument must be specified',
14});
15
16assert.throws(() => {
17  new net.Socket().connect();
18}, {
19  code: 'ERR_MISSING_ARGS',
20  message: 'The "options" or "port" or "path" argument must be specified',
21});
22
23assert.throws(() => {
24  net.connect({});
25}, {
26  code: 'ERR_MISSING_ARGS',
27  message: 'The "options" or "port" or "path" argument must be specified',
28});
29
30assert.throws(() => {
31  new net.Socket().connect({});
32}, {
33  code: 'ERR_MISSING_ARGS',
34  message: 'The "options" or "port" or "path" argument must be specified',
35});
36