Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit ca39b9c

Browse files
committed
Added very basic mocks for net and dns
1 parent 0a54c5f commit ca39b9c

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

mock/dns.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
exports.lookup = exports.resolve4 =
2+
exports.resolve6 = exports.resolveCname =
3+
exports.resolveMx = exports.resolveNs =
4+
exports.resolveTxt = exports.resolveSrv =
5+
exports.resolveNaptr = exports.reverse =
6+
exports.resolve =
7+
function () {
8+
if (!arguments.length) return;
9+
10+
var callback = arguments[arguments.length - 1];
11+
if (callback && typeof callback === 'function') {
12+
callback(null, '0.0.0.0')
13+
}
14+
}
15+

mock/net.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
exports.createServer =
2+
exports.createConnection =
3+
exports.connect =
4+
function () {};
5+
6+
exports.isIP =
7+
exports.isIPv4 =
8+
exports.isIPv6 =
9+
function () { return true };
10+

0 commit comments

Comments
 (0)