test: add TXT DNS record lookup test
authorBen Noordhuis <info@bnoordhuis.nl>
Mon, 3 Oct 2011 14:50:09 +0000 (16:50 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Mon, 3 Oct 2011 14:50:09 +0000 (16:50 +0200)
test/internet/test-dns.js

index f738ab6..28a7a2d 100644 (file)
@@ -248,6 +248,18 @@ TEST(function test_resolveCname(done) {
 });
 
 
+TEST(function test_resolveTxt(done) {
+  var req = dns.resolveTxt('google.com', function(err, records) {
+    if (err) throw err;
+    assert.equal(records.length, 1);
+    assert.equal(records[0].indexOf('v=spf1'), 0);
+    done();
+  });
+
+  checkWrap(req);
+});
+
+
 TEST(function test_lookup_ipv4_explicit(done) {
   var req = dns.lookup('www.google.com', 4, function(err, ip, family) {
     if (err) throw err;