mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
failing test for EventEmitter.once backwards compatibility
This commit is contained in:
parent
4213d528f0
commit
f9f7e0759d
19
test/unit/utils-tests.js
Normal file
19
test/unit/utils-tests.js
Normal 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);
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user