(err: Error | null, records?: dns.SrvRecord[])
| 30 | } |
| 31 | |
| 32 | function stubDns(err: Error | null, records?: dns.SrvRecord[]) { |
| 33 | if (err) { |
| 34 | sinon.stub(dns.promises, 'resolve').rejects(err); |
| 35 | } else { |
| 36 | sinon.stub(dns.promises, 'resolve').resolves(records); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | afterEach(function () { |
| 41 | sinon.restore(); |