-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test] added the lib/caronte/streams/forward.js initial test, one tes…
…t pending
- Loading branch information
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
var ForwardStream = require('../lib/caronte/streams/forward'), | ||
expect = require('expect.js'), | ||
Writable = require('stream').Writable, | ||
http = require('http'); | ||
|
||
|
||
describe('lib/caronte/passes/web.js', function () { | ||
describe('forward stream constructor', function () { | ||
it('should be an instance of Writable stream and get the correct options and methods', function () { | ||
var stubOptions = { | ||
key: 'value' | ||
}; | ||
var forwardProxy = new ForwardStream(stubOptions); | ||
|
||
expect(forwardProxy).to.be.a(Writable); | ||
expect(forwardProxy.options).to.eql({ key: 'value' }); | ||
expect(forwardProxy.onPipe).to.be.a('function'); | ||
expect(forwardProxy.onFinish).to.be.a('function'); | ||
expect(forwardProxy._events).to.have.property('pipe'); | ||
expect(forwardProxy._events).to.have.property('finish'); | ||
}); | ||
}); | ||
|
||
describe('should pipe the request and finish it', function () { | ||
it('should make the request on pipe and finish it'); | ||
var stubOptions = { | ||
target: { | ||
hostname : 'www.google.com', | ||
port : '80', | ||
path : '/' | ||
} | ||
}; | ||
|
||
var forwardProxy = new ForwardStream({}); | ||
|
||
}); | ||
}); |