This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 2 files changed +40
-0
lines changed 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 113
113
"ipns" : " ~0.5.2" ,
114
114
"is-domain-name" : " ^1.0.1" ,
115
115
"is-ipfs" : " ~0.6.1" ,
116
+ "is-domain-name" : " ^1.0.1" ,
116
117
"is-pull-stream" : " ~0.0.0" ,
117
118
"is-stream" : " ^2.0.0" ,
118
119
"iso-url" : " ~0.4.6" ,
Original file line number Diff line number Diff line change @@ -500,4 +500,43 @@ describe('name', function () {
500
500
done ( )
501
501
} )
502
502
} )
503
+
504
+ describe ( 'working with dns' , function ( ) {
505
+ let node
506
+ let ipfsd
507
+
508
+ before ( function ( done ) {
509
+ df . spawn ( {
510
+ exec : IPFS ,
511
+ args : [ `--pass ${ hat ( ) } ` , '--offline' ] ,
512
+ config : { Bootstrap : [ ] }
513
+ } , ( err , _ipfsd ) => {
514
+ expect ( err ) . to . not . exist ( )
515
+ ipfsd = _ipfsd
516
+ node = _ipfsd . api
517
+ done ( )
518
+ } )
519
+ } )
520
+
521
+ after ( ( done ) => ipfsd . stop ( done ) )
522
+
523
+ it ( 'should resolve ipfs.io' , async ( ) => {
524
+ const r = await node . name . resolve ( 'ipfs.io' , { recursive : false } )
525
+ return expect ( r ) . to . eq ( '/ipns/website.ipfs.io' )
526
+ } )
527
+
528
+ it ( 'should resolve /ipns/ipfs.io recursive' , async ( ) => {
529
+ const r = await node . name . resolve ( 'ipfs.io' , { recursive : true } )
530
+
531
+ return expect ( r . substr ( 0 , 6 ) ) . to . eql ( '/ipfs/' )
532
+ } )
533
+
534
+ it ( 'should fail to resolve /ipns/ipfs.a' , async ( ) => {
535
+ try {
536
+ await node . name . resolve ( 'ipfs.a' )
537
+ } catch ( err ) {
538
+ expect ( err ) . to . exist ( )
539
+ }
540
+ } )
541
+ } )
503
542
} )
You can’t perform that action at this time.
0 commit comments