File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,19 @@ describe('request', function () {
175
175
. then ( done , done ) ;
176
176
} ) ;
177
177
178
+ it ( 'agent can be used to set default headers' , function ( done ) {
179
+ var agent = request . agent ( 'https://httpbin.org' ) ;
180
+ agent . auth ( "user" , "passwd" ) ;
181
+
182
+ agent
183
+ . get ( '/basic-auth/user/passwd' )
184
+ . then ( function ( res ) {
185
+ res . should . have . status ( 200 ) ;
186
+ agent . close ( ) ;
187
+ } )
188
+ . then ( done , done ) ;
189
+ } ) ;
190
+
178
191
it ( 'automatically closes the server down once done with it' , function ( done ) {
179
192
var server = require ( 'http' ) . createServer ( function ( req , res ) {
180
193
res . writeHeader ( 200 , { 'content-type' : 'text/plain' } ) ;
@@ -240,6 +253,6 @@ describe('request', function () {
240
253
res . body . cookies . biz . should . equal ( 'baz' ) ;
241
254
} )
242
255
. then ( done , done ) ;
243
- } ) ;
256
+ } ) ;
244
257
} ) ;
245
258
} ) ;
You can’t perform that action at this time.
0 commit comments