I'm removing the check for event.disconnect as it never returns true from the serialport library. Only checking for the valid responses of event && event.disconnected allows the unplug detection to work in the latest serialport version.
referencing the issue - https://github.com/firmata/firmata.js/issues/234
Coverage remained the same at 99.863% when pulling bb60050526322f9c02a4b61ec8283ea888426be8 on MattTavares:patch-1 into 54dda2d2112e9fc3f997324df22d59f6e3d05298 on firmata:master.
I'm removing the check for event.disconnect as it never returns true from the serialport library. Only checking for the valid responses of event && event.disconnected allows the unplug detection to work in the latest serialport version. referencing the issue - https://github.com/firmata/firmata.js/issues/234