Skip to content

Misleading values in returned object when the cable is unplugged or the host doesn't exist #133

@lucamarogna

Description

@lucamarogna

Writing these tests:

console.log( await ping.promise.probe('fakehostdoesntexist.com') );
// Manually unplug the cable...
console.log( await ping.promise.probe('google.com') );

both result in:

{
  host: 'unknown',
  alive: false,
  output: '',
  time: 'unknown',
  times: [],
  min: 'unknown',
  max: 'unknown',
  avg: 'unknown',
  stddev: 'unknown',
  packetLoss: 'unknown'
}

(the latter happen only when the network cable is unplugged)

I think it should have at least the host property setted to the actual host pinged. Not sure for other properties as ping implementation may vary depending on platforms (I'm on Ubuntu 18.04.3).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions