flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
22
BACK_BACK/node_modules/stream-http/test/browser/auth.js
generated
vendored
Executable file
22
BACK_BACK/node_modules/stream-http/test/browser/auth.js
generated
vendored
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
var Buffer = require('buffer').Buffer
|
||||
var test = require('tape')
|
||||
|
||||
var http = require('../..')
|
||||
|
||||
test('authentication', function (t) {
|
||||
http.get({
|
||||
path: '/auth',
|
||||
auth: 'TestUser:trustno1'
|
||||
}, function (res) {
|
||||
var buffers = []
|
||||
|
||||
res.on('end', function () {
|
||||
t.ok(new Buffer('You\'re in!').equals(Buffer.concat(buffers)), 'authentication succeeded')
|
||||
t.end()
|
||||
})
|
||||
|
||||
res.on('data', function (data) {
|
||||
buffers.push(data)
|
||||
})
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue