diff options
author | James M Snell <jasnell@gmail.com> | 2016-09-09 10:34:55 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2016-10-10 08:52:03 -0700 |
commit | 07b54ec4ca3ed923f2db4b83daa2134d42d3b84a (patch) | |
tree | 6272de2890be223e3b40dadc97ee095e35b5ce3e /test/parallel/test-c-ares.js | |
parent | 1bfa02639c857fb26042c20c8749884f4551a0d1 (diff) | |
download | android-node-v8-07b54ec4ca3ed923f2db4b83daa2134d42d3b84a.tar.gz android-node-v8-07b54ec4ca3ed923f2db4b83daa2134d42d3b84a.tar.bz2 android-node-v8-07b54ec4ca3ed923f2db4b83daa2134d42d3b84a.zip |
test: various test improvements
* Favor strictEqual
* Use const where appropriate
* Modernize where possible
PR-URL: https://github.com/nodejs/node/pull/8468
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test/parallel/test-c-ares.js')
-rw-r--r-- | test/parallel/test-c-ares.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/test/parallel/test-c-ares.js b/test/parallel/test-c-ares.js index 0da5d5210c..2eb824b5df 100644 --- a/test/parallel/test-c-ares.js +++ b/test/parallel/test-c-ares.js @@ -7,30 +7,29 @@ const dns = require('dns'); // Try resolution without callback -dns.lookup(null, common.mustCall(function(error, result, addressType) { +dns.lookup(null, common.mustCall((error, result, addressType) => { + assert.ifError(error); assert.strictEqual(null, result); assert.strictEqual(4, addressType); })); -dns.lookup('127.0.0.1', common.mustCall(function(error, result, addressType) { +dns.lookup('127.0.0.1', common.mustCall((error, result, addressType) => { + assert.ifError(error); assert.strictEqual('127.0.0.1', result); assert.strictEqual(4, addressType); })); -dns.lookup('::1', common.mustCall(function(error, result, addressType) { +dns.lookup('::1', common.mustCall((error, result, addressType) => { + assert.ifError(error); assert.strictEqual('::1', result); assert.strictEqual(6, addressType); })); // Try calling resolve with an unsupported type. -assert.throws(function() { - dns.resolve('www.google.com', 'HI'); -}, /Unknown type/); +assert.throws(() => dns.resolve('www.google.com', 'HI'), /Unknown type/); // Try calling resolve with an unsupported type that's an object key -assert.throws(function() { - dns.resolve('www.google.com', 'toString'); -}, /Unknown type/); +assert.throws(() => dns.resolve('www.google.com', 'toString'), /Unknown type/); // Windows doesn't usually have an entry for localhost 127.0.0.1 in // C:\Windows\System32\drivers\etc\hosts |