Skip to content

Commit

Permalink
Made a change that eliminates the following bug (see http://github.co…
Browse files Browse the repository at this point in the history
…m/cloudhead/vows/issues#issue/16): Sometimes you want to test an object that inherits from EventEmitter. In this case, if you return said testable object as the topic, then the code hangs if the EventEmitter subclass instance that I'm testing doesn't emit "success" or "error."
  • Loading branch information
bnoguchi authored and Alexis Sellier committed Oct 13, 2010
1 parent 679e8a6 commit 213d6cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/vows/suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ this.Suite.prototype = new(function () {

// If the topic doesn't return an event emitter (such as a promise),
// we create it ourselves, and emit the value on the next tick.
if (! (topic instanceof events.EventEmitter)) {
if (! (topic && topic.constructor === events.EventEmitter)) {
ctx.emitter = new(events.EventEmitter);

if (! ctx._callback) {
Expand Down

0 comments on commit 213d6cd

Please sign in to comment.