-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bind stream module as event emitter Remove third-party wrapping Remove separate request/response binding Cover w/ test Improve naming in tests
- Loading branch information
Gábor Döbrei
committed
Jul 29, 2015
1 parent
d11581f
commit 9d18174
Showing
8 changed files
with
50 additions
and
56 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
var stream = require('stream'); | ||
|
||
var cls = require('continuation-local-storage'); | ||
var expect = require('chai').expect; | ||
var sinon = require('sinon'); | ||
|
||
var collectorConfig = require('../config'); | ||
var wraps = require('../wraps'); | ||
|
||
describe('Trace', function () { | ||
|
||
before(function () { | ||
sinon.sandbox.stub(collectorConfig, 'appName', 'test'); | ||
sinon.sandbox.stub(collectorConfig, 'reporterType', 'logstash'); | ||
sinon.sandbox.stub(collectorConfig, 'reporterConfig', | ||
'{"type":"tcp","host":"localhost","port":12201}'); | ||
}); | ||
|
||
after(function () { | ||
wraps.uninstrument(); | ||
}); | ||
|
||
it('binds the stream core module', function () { | ||
var originalCreateNamespace = cls.createNamespace; | ||
var bindEmitterSpy; | ||
|
||
var sandbox = this.sandbox; | ||
|
||
sinon.sandbox.stub(cls, 'createNamespace', function (str) { | ||
var ns = originalCreateNamespace(str); | ||
bindEmitterSpy = sandbox.spy(ns, 'bindEmitter'); | ||
return ns; | ||
}); | ||
|
||
require('../'); | ||
|
||
expect(bindEmitterSpy).to.have.been.calledWith(stream.prototype); | ||
}); | ||
}); |
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
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
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
This file was deleted.
Oops, something went wrong.