MCPcopy
hub / github.com/mongodb/node-mongodb-native / stubDns

Function stubDns

test/unit/sdam/srv_polling.test.ts:32–38  ·  view source on GitHub ↗
(err: Error | null, records?: dns.SrvRecord[])

Source from the content-addressed store, hash-verified

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();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected