Conditional for reject/resolve now checks whether status is undefined rather than truthy. This allows for mocking connection refused, as  will normally return status 0 in such a case. In previous implementation such a status would be considered falsy and it would resolve with a status 200, rather than rejecting with status 0