code: function (next) {
  
        if (!server) {
          if (options.port) {
  
            portscanner.checkPortStatus(options.port, options.host,
              function (error, status) {
                if (status === 'closed') {
                  next();
                } else {
                  fatal('Port ' + options.port + ' is already in use by another process.');
                }
              });
  
          } else {
  
            portscanner.findAPortNotInUse(8888, 65535, options.host,
              function (error, foundPort) {
                options.port = foundPort;
                next();
              });
          }
        } else {
          next();
        }
      }
docs: check port