File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -498,6 +498,34 @@ TEST(async function test_resolveTxt(done) {
498
498
checkWrap ( req ) ;
499
499
} ) ;
500
500
501
+ TEST ( async function test_resolveTxt_ttl ( done ) {
502
+ function validateResult ( result ) {
503
+ assert . ok ( result . length > 0 ) ;
504
+
505
+ for ( const item of result ) {
506
+ assert . strictEqual ( typeof item , 'object' ) ;
507
+ assert . strictEqual ( typeof item . ttl , 'number' ) ;
508
+ assert . strictEqual ( typeof item . txt , 'string' ) ;
509
+ assert . ok ( item . ttl >= 0 ) ;
510
+ assert . ok ( item . txt . startsWith ( 'v=spf1' ) ) ;
511
+ }
512
+ }
513
+
514
+ validateResult ( await dnsPromises . resolveTxt ( addresses . TXT_HOST , {
515
+ ttl : true
516
+ } ) ) ;
517
+
518
+ const req = dns . resolveTxt ( addresses . TXT_HOST , {
519
+ ttl : true
520
+ } , function ( err , result ) {
521
+ assert . ifError ( err ) ;
522
+ validateResult ( result ) ;
523
+ done ( ) ;
524
+ } ) ;
525
+
526
+ checkWrap ( req ) ;
527
+ } ) ;
528
+
501
529
TEST ( function test_resolveTxt_failure ( done ) {
502
530
dnsPromises . resolveTxt ( addresses . NOT_FOUND )
503
531
. then ( common . mustNotCall ( ) )
You can’t perform that action at this time.
0 commit comments