@@ -37,14 +37,14 @@ describe('.bootstrap', function () {
37
37
38
38
describe ( '.add' , ( ) => {
39
39
it ( 'returns an error when called with an invalid arg' , ( done ) => {
40
- ipfsd . api . bootstrap . add ( invalidArg , ( err ) => {
40
+ ipfs . bootstrap . add ( invalidArg , ( err ) => {
41
41
expect ( err ) . to . be . an . instanceof ( Error )
42
42
done ( )
43
43
} )
44
44
} )
45
45
46
46
it ( 'returns a list of containing the bootstrap peer when called with a valid arg (ip4)' , ( done ) => {
47
- ipfsd . api . bootstrap . add ( validIp4 , ( err , res ) => {
47
+ ipfs . bootstrap . add ( validIp4 , ( err , res ) => {
48
48
expect ( err ) . to . not . exist ( )
49
49
expect ( res ) . to . be . eql ( { Peers : [ validIp4 ] } )
50
50
peers = res . Peers
@@ -55,7 +55,7 @@ describe('.bootstrap', function () {
55
55
} )
56
56
57
57
it ( 'returns a list of bootstrap peers when called with the default option' , ( done ) => {
58
- ipfsd . api . bootstrap . add ( { default : true } , ( err , res ) => {
58
+ ipfs . bootstrap . add ( { default : true } , ( err , res ) => {
59
59
expect ( err ) . to . not . exist ( )
60
60
peers = res . Peers
61
61
expect ( peers ) . to . exist ( )
@@ -67,7 +67,7 @@ describe('.bootstrap', function () {
67
67
68
68
describe ( '.list' , ( ) => {
69
69
it ( 'returns a list of peers' , ( done ) => {
70
- ipfsd . api . bootstrap . list ( ( err , res ) => {
70
+ ipfs . bootstrap . list ( ( err , res ) => {
71
71
expect ( err ) . to . not . exist ( )
72
72
peers = res . Peers
73
73
expect ( peers ) . to . exist ( )
@@ -78,14 +78,14 @@ describe('.bootstrap', function () {
78
78
79
79
describe ( '.rm' , ( ) => {
80
80
it ( 'returns an error when called with an invalid arg' , ( done ) => {
81
- ipfsd . api . bootstrap . rm ( invalidArg , ( err ) => {
81
+ ipfs . bootstrap . rm ( invalidArg , ( err ) => {
82
82
expect ( err ) . to . be . an . instanceof ( Error )
83
83
done ( )
84
84
} )
85
85
} )
86
86
87
87
it ( 'returns empty list because no peers removed when called without an arg or options' , ( done ) => {
88
- ipfsd . api . bootstrap . rm ( null , ( err , res ) => {
88
+ ipfs . bootstrap . rm ( null , ( err , res ) => {
89
89
expect ( err ) . to . not . exist ( )
90
90
peers = res . Peers
91
91
expect ( peers ) . to . exist ( )
@@ -95,7 +95,7 @@ describe('.bootstrap', function () {
95
95
} )
96
96
97
97
it ( 'returns list containing the peer removed when called with a valid arg (ip4)' , ( done ) => {
98
- ipfsd . api . bootstrap . rm ( null , ( err , res ) => {
98
+ ipfs . bootstrap . rm ( null , ( err , res ) => {
99
99
expect ( err ) . to . not . exist ( )
100
100
peers = res . Peers
101
101
expect ( peers ) . to . exist ( )
@@ -105,7 +105,7 @@ describe('.bootstrap', function () {
105
105
} )
106
106
107
107
it ( 'returns list of all peers removed when all option is passed' , ( done ) => {
108
- ipfsd . api . bootstrap . rm ( null , { all : true } , ( err , res ) => {
108
+ ipfs . bootstrap . rm ( null , { all : true } , ( err , res ) => {
109
109
expect ( err ) . to . not . exist ( )
110
110
peers = res . Peers
111
111
expect ( peers ) . to . exist ( )
@@ -120,21 +120,21 @@ describe('.bootstrap', function () {
120
120
121
121
describe ( '.add' , ( ) => {
122
122
it ( 'returns an error when called without args or options' , ( ) => {
123
- return ipfsd . api . bootstrap . add ( null )
123
+ return ipfs . bootstrap . add ( null )
124
124
. catch ( ( err ) => {
125
125
expect ( err ) . to . be . an . instanceof ( Error )
126
126
} )
127
127
} )
128
128
129
129
it ( 'returns an error when called with an invalid arg' , ( ) => {
130
- return ipfsd . api . bootstrap . add ( invalidArg )
130
+ return ipfs . bootstrap . add ( invalidArg )
131
131
. catch ( ( err ) => {
132
132
expect ( err ) . to . be . an . instanceof ( Error )
133
133
} )
134
134
} )
135
135
136
136
it ( 'returns a list of peers when called with a valid arg (ip4)' , ( ) => {
137
- return ipfsd . api . bootstrap . add ( validIp4 )
137
+ return ipfs . bootstrap . add ( validIp4 )
138
138
. then ( ( res ) => {
139
139
expect ( res ) . to . be . eql ( { Peers : [ validIp4 ] } )
140
140
peers = res . Peers
@@ -144,7 +144,7 @@ describe('.bootstrap', function () {
144
144
} )
145
145
146
146
it ( 'returns a list of default peers when called with the default option' , ( ) => {
147
- return ipfsd . api . bootstrap . add ( null , { default : true } )
147
+ return ipfs . bootstrap . add ( null , { default : true } )
148
148
. then ( ( res ) => {
149
149
peers = res . Peers
150
150
expect ( peers ) . to . exist ( )
@@ -155,7 +155,7 @@ describe('.bootstrap', function () {
155
155
156
156
describe ( '.list' , ( ) => {
157
157
it ( 'returns a list of peers' , ( ) => {
158
- return ipfsd . api . bootstrap . list ( )
158
+ return ipfs . bootstrap . list ( )
159
159
. then ( ( res ) => {
160
160
peers = res . Peers
161
161
expect ( peers ) . to . exist ( )
@@ -165,14 +165,14 @@ describe('.bootstrap', function () {
165
165
166
166
describe ( '.rm' , ( ) => {
167
167
it ( 'returns an error when called with an invalid arg' , ( ) => {
168
- return ipfsd . api . bootstrap . rm ( invalidArg )
168
+ return ipfs . bootstrap . rm ( invalidArg )
169
169
. catch ( ( err ) => {
170
170
expect ( err ) . to . be . an . instanceof ( Error )
171
171
} )
172
172
} )
173
173
174
174
it ( 'returns empty list when called without an arg or options' , ( ) => {
175
- return ipfsd . api . bootstrap . rm ( null )
175
+ return ipfs . bootstrap . rm ( null )
176
176
. then ( ( res ) => {
177
177
peers = res . Peers
178
178
expect ( peers ) . to . exist ( )
@@ -181,7 +181,7 @@ describe('.bootstrap', function () {
181
181
} )
182
182
183
183
it ( 'returns list containing the peer removed when called with a valid arg (ip4)' , ( ) => {
184
- return ipfsd . api . bootstrap . rm ( null )
184
+ return ipfs . bootstrap . rm ( null )
185
185
. then ( ( res ) => {
186
186
peers = res . Peers
187
187
expect ( peers ) . to . exist ( )
@@ -190,7 +190,7 @@ describe('.bootstrap', function () {
190
190
} )
191
191
192
192
it ( 'returns list of all peers removed when all option is passed' , ( ) => {
193
- return ipfsd . api . bootstrap . rm ( null , { all : true } )
193
+ return ipfs . bootstrap . rm ( null , { all : true } )
194
194
. then ( ( res ) => {
195
195
peers = res . Peers
196
196
expect ( peers ) . to . exist ( )
0 commit comments