failing test for EventEmitter.once backwards compatibility

This commit is contained in:
brianc 2010-10-23 12:42:01 -05:00
parent 4213d528f0
commit f9f7e0759d

19
test/unit/utils-tests.js Normal file
View File

@ -0,0 +1,19 @@
require(__dirname + '/test-helper');
//this tests the monkey patching
//to ensure comptability with older
//versions of node
test("EventEmitter.once", function() {
//an event emitter
var stream = new MemoryStream();
var callCount = 0;
stream.once('single', function() {
callCount++;
});
stream.emit('single');
stream.emit('single');
assert.equal(callCount, 1);
});