From 235cbbe4d8087ebd62dd9271a4d585458ffed45a Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 22 May 2017 10:27:43 -0700 Subject: test: refactor test-dns * track callback invocations with common.mustCall() and common.mustNotCall() * remove test in test/internet/test-dns.js that is duplicated in test/parallel/test-dns.js * move tests that might perform a DNS query from test test/parallel/test-dns.js to test/internet/test-dns.js PR-URL: https://github.com/nodejs/node/pull/13163 Reviewed-By: Refael Ackermann Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig --- test/internet/test-dns.js | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'test/internet') diff --git a/test/internet/test-dns.js b/test/internet/test-dns.js index 269ba58b70..fc001ff965 100644 --- a/test/internet/test-dns.js +++ b/test/internet/test-dns.js @@ -402,19 +402,6 @@ TEST(function test_lookup_failure(done) { }); -TEST(function test_lookup_null(done) { - const req = dns.lookup(null, function(err, ip, family) { - assert.ifError(err); - assert.strictEqual(ip, null); - assert.strictEqual(family, 4); - - done(); - }); - - checkWrap(req); -}); - - TEST(function test_lookup_ip_all(done) { const req = dns.lookup('127.0.0.1', {all: true}, function(err, ips, family) { assert.ifError(err); @@ -578,3 +565,12 @@ process.on('exit', function() { assert.strictEqual(expected, completed); assert.ok(getaddrinfoCallbackCalled); }); + + +assert.doesNotThrow(() => dns.lookup('nodejs.org', 6, common.mustCall())); + +assert.doesNotThrow(() => dns.lookup('nodejs.org', {}, common.mustCall())); + +assert.doesNotThrow(() => dns.lookupService('0.0.0.0', '0', common.mustCall())); + +assert.doesNotThrow(() => dns.lookupService('0.0.0.0', 0, common.mustCall())); -- cgit v1.2.3