mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
fix Emitter.call(this) usage
This commit is contained in:
@@ -1,6 +1,22 @@
|
||||
|
||||
var Emitter = require('..');
|
||||
|
||||
function Custom() {
|
||||
Emitter.call(this)
|
||||
}
|
||||
|
||||
Custom.prototype.__proto__ = Emitter.prototype;
|
||||
|
||||
describe('Custom', function(){
|
||||
describe('with Emitter.call(this)', function(){
|
||||
it('should work', function(done){
|
||||
var emitter = new Custom;
|
||||
emitter.on('foo', done);
|
||||
emitter.emit('foo');
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('Emitter', function(){
|
||||
describe('.on(event, fn)', function(){
|
||||
it('should add listeners', function(){
|
||||
|
||||
Reference in New Issue
Block a user